Commit Graph

273 Commits

Author SHA1 Message Date
Rafael Espindola
c8b9551a8f Port ExceptionDemo to MCJIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181168 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05 20:57:58 +00:00
Rafael Espindola
58c3aa2049 Add support for other typeinfo encodings in the ExceptionDemo.
The old jit always uses DW_EH_PE_absptr, but MCJIT can use other encodings.
This is in preparation for adding EH support to MCJIT, but not directly
related, so I am committing it first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01 21:05:05 +00:00
Rafael Espindola
fbb2c7adc2 The exception demo needs its symbols exported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26 19:07:40 +00:00
Dmitri Gribenko
a6f10317bf Update links to "Itanium C++ ABI: Exception Handling" document
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13 15:53:09 +00:00
Chandler Carruth
0a08460599 Update the examples for the new header file locations.
Sorry for the fallout here, I forgot the examples aren't built by
default any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171371 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:56:33 +00:00
Chandler Carruth
4ca7e09b7c Sort the #include lines of the examples/... tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 10:16:57 +00:00
Rafael Espindola
250ab62a62 Fix gcc's -Wunused-but-set-variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 00:56:44 +00:00
Micah Villmow
b8bce928f4 Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166596 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:25:11 +00:00
Micah Villmow
2f87640b86 Delete a directory that wasn't supposed to be checked in yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:20:04 +00:00
Quentin Colombet
92b0d8cf2c Test commit access
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 16:03:18 +00:00
NAKAMURA Takumi
4c856ee1f8 ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 14:11:48 +00:00
NAKAMURA Takumi
9f469a0ca3 ExceptionDemo.cpp: Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 14:11:43 +00:00
Micah Villmow
2b4b44e0d2 Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 16:37:04 +00:00
Chandler Carruth
06cb8ed006 Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h
This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 12:38:19 +00:00
Arnaud A. de Grandmaison
5791df830d Remove trailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 22:26:01 +00:00
Benjamin Kramer
d9b0b02561 Fix typos found by http://github.com/lyda/misspell-check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 10:20:22 +00:00
Michael J. Spencer
75338097c7 Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 19:27:54 +00:00
Chandler Carruth
637f949a7f Switch to a more idiomatic way of silencing unused variable warnings in
release builds. Silences clang's -Wself-assign.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 00:02:49 +00:00
Peter Collingbourne
793a32dfb6 Update ExceptionDemo to use ConstantDataArray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149867 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 14:09:13 +00:00
Bill Wendling
08e8db423d Update to the new EH system...remove OLD EH code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149728 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 00:29:12 +00:00
Francois Pichet
a0935775db Fix BrainF compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149375 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 09:35:01 +00:00
Daniel Dunbar
4ab406d7fc LLVMBuild: Remove trailing newline, which irked me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 19:48:00 +00:00
Peter Collingbourne
d40e103ea5 EngineBuilder: support for custom TargetOptions. Fixes the
ExceptionDemo example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 23:58:57 +00:00
Daniel Dunbar
a3a2dfd4a2 build: Add initial cut at LLVMBuild.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:53:17 +00:00
Garrison Venn
113aa86120 Changed comments on foreign C++ exceptions (generated with type info 7),
handling with references to 
http://sourcery.mentor.com/public/cxx-abi/abi-eh.html (r 1.22).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140695 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 10:53:56 +00:00
Garrison Venn
9cb5086f2a Modified demo to use 3.0 resume instruction vs calling _Unwine_Resume.
Also conducted some reformatting. As the LLVM coding standard doc does not
seem to touch on how to align function arguments, and format code longer than
80 cols in general, the confusion persists. There is the golden rule, but as
this code has gone through several styles to deal with this, the golden rule
seems to be ignored. The latest reformatting effort tries to match the other
source files as much as possible.

Tested on OS X 10.7.1 with, and without the OLD_EXC_SYSTEM defined. Have NOT
tested on LINUX.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 14:45:10 +00:00
Garrison Venn
85500714c4 Converted Exception demo over to using new 3.0 landingpad instruction. This
was compiled and tested on OS X 10.7.1. It was not tested on LINUX. In 
addition the defined OLD_EXC_SYSTEM was not tested with this version.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140303 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 15:45:14 +00:00
Garrison Venn
aae66fad05 This is a hack to get the demo working with the new 3.0 exception
infrastructure. As this makes the demo no longer a demo, and especially not a 
demo on how to use the llvm exception mechanism, this hack will shortly be 
changed to use the new 3.0 exception infrastructure. However for the time being 
this demo is an example on how to use the AutoUpgrade 
UpgradeExceptionHandling(...) function on < 3.0 exception handling code.                          


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140301 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 14:07:50 +00:00
Evan Cheng
3e74d6fdd2 Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 18:08:43 +00:00
Jay Foad
dab3d29605 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 14:31:17 +00:00
Chris Lattner
4b3d5469fb update for recent api changes. I have a hard time believing that this is actually a useful example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135374 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 04:52:58 +00:00
Chris Lattner
77613d4135 update this to build with a recent IRBuilder change and de-constify types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 04:52:09 +00:00
Francois Pichet
0bd9d3af54 Convert CallInst and InvokeInst APIs to use ArrayRef. For the LLVM examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 10:59:52 +00:00
Benjamin Kramer
eb9a85f09e Change Intrinsic::getDeclaration and friends to take an ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 17:45:39 +00:00
Francois Pichet
e8b323aed4 Remove the const from Type after of Jay deconstify work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135000 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:04:11 +00:00
Garrison Venn
c0f33cb590 Reverted 134901 because of 134959. Did not use svn merge -r but rather:
1,$s/llvm::Type::getInt\(..\)Ty(builder.getContext())/builder.getInt\1Ty()/g
1,$s/builder.getInt\(..*\)Ty()->getPointerTo()/builder.getInt\1PtrTy()/g

vi sub commands (second one was not a reversion but requested by 
Tobias Grosser.

Mod was tested, but other examples have failed to build as they are currently 
being thrashed with the const qualifier removal change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134985 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 15:34:42 +00:00
Francois Pichet
a3d57e6980 Fix the BrainF build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134975 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 08:43:36 +00:00
John Wiegley
d1c2bd8e6e fix some examples
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 22:39:46 +00:00
Garrison Venn
6e6cdd00aa Modified demo to work with non const Type parameters as is required by new
type system. However most of these modifications were due to IRBuilder
(IRBuilderBase), not having been modified to NOT return such const qualified
free types. If IRBuilder does not change, as can also be seen in its 
instruction creation methods, to use const free types, it may be useful to have
ExceptionDemo drop IRBuilder usage. Modifying builder.getInt32Ty() to
llvm::Type::getInt32Ty(builder.getContext()) is pretty ugly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134901 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 16:31:53 +00:00
Johnny Chen
e5dfa8f697 Modify comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-09 20:11:46 +00:00
Eric Christopher
c3a627de3f Have the JIT tutorial use IRBuilder for the IR.
Patch by Jake Waskett!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-09 05:58:50 +00:00
Chris Lattner
7a2bdde0a0 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:18:47 +00:00
Garrison Venn
18bba84d77 Added new FIXME note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129360 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 12:30:10 +00:00
Eli Friedman
2227f154eb Get rid of useless comment; if a file uses functions from a given header,
it is obvious that it should be included.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129295 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 20:16:05 +00:00
Garrison Venn
2a7d4ad1f4 Because some systems have reported that this example would not build the
header file cstdio was added as an include.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 19:52:49 +00:00
Garrison Venn
64cfcefdeb Fixed more best practices, and explicit/implicit style guide issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 14:06:52 +00:00
Chris Lattner
626ab1ccad reindent this whole file and do a variety of stylistic cleanups.
This code is still a long way from following best practices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 18:02:51 +00:00
Chris Lattner
cad3f77fa8 fix this to build with the recent StructType changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 17:56:47 +00:00
Jay Foad
3ecfc861b4 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 11:28:46 +00:00
Jay Foad
d8b4fb4aab (Almost) always call reserveOperandSpace() on newly created PHINodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 11:19:20 +00:00
Erick Tryzelaar
01b4ccb6f7 Fix compiling the ocaml kaleidoscope tutorials
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 18:32:02 +00:00
Oscar Fuentes
af62935bce Do not re-test for the existence of pthread.h.
It was causing problems on the MinGW build. See PR8849.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 21:27:22 +00:00
Dan Gohman
ab7fa0885e Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 17:28:22 +00:00
Dan Gohman
dfa1a79b0c Update examples and documentation to explicitly add basicaa, now that it's
no longer included by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 18:41:10 +00:00
Oscar Fuentes
f0c55a9b97 Build with RTTI and exceptions disabled. Only in GCC for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 02:26:16 +00:00
Duncan Sands
18d52f2fb5 Convert a bunch of uses of 'bytecode' into 'bitcode'. This
is not everything, but the remaining cases are less trivial.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 20:09:55 +00:00
Garrison Venn
161b4c46a3 Removed TracingBrainF from examples Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 14:55:32 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Chris Lattner
03d1063d32 fit in 80 columns and don't crash on exit, fixes PR8080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113123 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 23:09:30 +00:00
Owen Anderson
060bb6bb4a Remove this from the main tree. I'll host it out of tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:34:26 +00:00
Owen Anderson
37b25ab2a9 Add a new example to the LLVM distribution: a trace-based Brainfuck compiler that uses LLVM as its code generator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 07:33:39 +00:00
Mikhail Glushenkov
8f2766df7f Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 20:03:53 +00:00
Chris Lattner
9908fec11e upgrade to use new intrinsics, patch by Dan Hipschman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 21:45:38 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Eric Christopher
688d58033a Fix up the ocaml kaleidoscope example as well.
Note that the example currently doesn't appear to work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 02:32:44 +00:00
Chris Lattner
b0e9eada32 fix several bugs in the tutorial, patch by Kevin Kelley!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 22:51:14 +00:00
Daniel Dunbar
f19f6a9deb Remove stray semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15 17:47:24 +00:00
Eric Christopher
2632bbf0de Make kaleidoscope use fp add/sub/mul.
Patch by Patrick Flannery!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14 06:03:16 +00:00
Duncan Sands
57b6e9eb6c Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 15:36:26 +00:00
Nick Lewycky
ec42dd6e19 Use provided llvm-defined variables instead of twisting user-controlled knobs.
No visible change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-24 05:07:24 +00:00
Benjamin Kramer
7c43f4357d Fix -Wcast-qual warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 11:50:37 +00:00
Erick Tryzelaar
d592e1a809 Fix the ocaml kaleidoscope tutorial to fix linking external libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 23:15:13 +00:00
Erick Tryzelaar
7129a67228 Don't always run the ocaml kaleidoscope tutorials.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:07:32 +00:00
Erick Tryzelaar
49457b8158 Add OCaml tutorial to the examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 19:32:27 +00:00
Jeffrey Yasskin
407fbdd161 Roll back r96959 again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 20:53:37 +00:00
Jeffrey Yasskin
ea6c39d417 Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 of
the examples shared to make sure the shared library keeps working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:10:07 +00:00
Garrison Venn
c80a1f7721 Modified examples Makefile to only build the ExceptionDemo example for
x86 and x86_64 on UNIX systems. Only OS X 10.6.2 (x86_64) and 32bit CentOS 5.2
with gcc 4.1.2 were tested. ARM UNIX build triggered failure motivating this
modification, as it seems that the ARM ABI does not support _Unwind_GetIP(...),
_Unwind_SetGR(...), and _Unwind_SetIP(...). From doing a quick browse of:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf,
it seems as if all other exception related apis are supported. Looks like
the port can be done to ARM. Thanks to Xerxes Rånby <xerxes@zafena.se> for
pointing out this error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 16:27:59 +00:00
Jeffrey Yasskin
42fc558624 Make Kaleidoscope not link against the interpreter, since that didn't
work anyway (Interpreter::getPointerToFunction doesn't return a
callable pointer), and improve the error message when an
ExecutionEngine can't be created.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 19:15:20 +00:00
Garrison Venn
0f08a27617 Prevented build on WINDOWS using default make system. Stopped WINDOWS build
at eh llvm/examples level using if check on LLVM_ON_UNIX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 03:38:29 +00:00
Garrison Venn
778086caf7 Prevented ExceptionDemo example being built on WINDOWS via if( NOT WIN32 )
check in examples cmake list file. This has NOT been tested.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 02:50:08 +00:00
Garrison Venn
a2c2f1ae84 Adds a JIT based exception handling example to the examples directory.
Both zero cost example domain specific, and C++ foreign exception handling are 
shown. The example's documentation fully explains how to run the example.

Notes:

1)   The code uses an extremely simple type info model.
2)   Only a single landing pad is used per unwind edge 
     (one call to llvm.eh.selector)
3)   llvm.eh.selector support for filter arguments is not given.
4)   llvm.eh.typeid.for is not used.
5)   Forced unwind behavior is not supported.
6)   Very little if any error handling is given.
7)   __attribute__((__aligned__)) is used.
8)   The code uses parts from the llvm compiler-rt project and
     the llvm Kaleidoscope example.
9)   The code has not been ported or tested on WINDOWS.
10)  The code was not tested with a cmake build.
11)  The code was tested for a debug build on 32bit X86 CentOS LINUX, 
     and both a debug and release build on OS X 10.6.2 (64bit).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 23:22:43 +00:00
Garrison Venn
f9fba3087e Repository access test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 12:00:02 +00:00
Jeffrey Yasskin
f0356fe140 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Daniel Dunbar
bdf49fc1ed This example requires RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 00:45:01 +00:00
Chris Lattner
18f0c677fa fix PR5649 by making fib use the JIT instead of the interpreter, patch by Perry Lorier!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 01:56:27 +00:00
Victor Hernandez
9d0b704e3e Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.
Here is the original commit message:

This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.

Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 00:16:28 +00:00
Victor Hernandez
df98761d08 Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 01:33:24 +00:00
Victor Hernandez
24f934d055 Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 00:03:03 +00:00
Victor Hernandez
046e78ce55 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:43:48 +00:00
Victor Hernandez
13ad5aaaff Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:00:19 +00:00
Douglas Gregor
12adce4e1a Make ParallelJIT pthreads linking with CMake slightly less broken
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 04:00:13 +00:00
Victor Hernandez
3e0c99a26f Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:11:52 +00:00
Victor Hernandez
96b930ddc7 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 17:47:49 +00:00
Erick Tryzelaar
31c6c5d58a Add examples for Kaleidoscope chapters 2 through 6.
Conflicts:

	examples/Makefile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:15:19 +00:00
Erick Tryzelaar
a4eb1a5cba Rename Kaleidoscope to show that it's for Chapter 7 of the tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:15:00 +00:00
Erick Tryzelaar
fd1ec5e68b Sync c++ kaleidoscope tutorial with test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:14:49 +00:00
Reid Kleckner
60130f0e90 Allocate the module provider in the Kaleidoscope code on the heap, not the stack, so that it can be properly deleted. Also update the tutorial with the new code. This fixes PR4762, hopefully better than the last time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 20:58:25 +00:00
Dan Gohman
baa26395cc Make LLVM command-line tools overwrite their output files without -f.
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".

Add a -f option to llvm-extract and llvm-link, for consistency.

Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.

Update Makefiles and documentation accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:34:52 +00:00
Reid Kleckner
9e6f3f2f14 Fixed double free in Kaleidoscope. Fixes PR4762.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79896 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 05:42:21 +00:00