Commit Graph

167 Commits

Author SHA1 Message Date
Chris Lattner 0ab5e2cded Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Garrison Venn a0f6ecb01f Added new FIXME note
llvm-svn: 129360
2011-04-12 12:30:10 +00:00
Eli Friedman 2c81975bae Get rid of useless comment; if a file uses functions from a given header,
it is obvious that it should be included.

llvm-svn: 129295
2011-04-11 20:16:05 +00:00
Garrison Venn 56c5ca2ee1 Because some systems have reported that this example would not build the
header file cstdio was added as an include.

llvm-svn: 129291
2011-04-11 19:52:49 +00:00
Garrison Venn 88bd9d6bb8 Fixed more best practices, and explicit/implicit style guide issues.
llvm-svn: 129245
2011-04-10 14:06:52 +00:00
Chris Lattner a868bbbb66 reindent this whole file and do a variety of stylistic cleanups.
This code is still a long way from following best practices.

llvm-svn: 129140
2011-04-08 18:02:51 +00:00
Chris Lattner ca320f54da fix this to build with the recent StructType changes.
llvm-svn: 129139
2011-04-08 17:56:47 +00:00
Jay Foad 52131344a2 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad e0938d8a87 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Erick Tryzelaar 201b7d75b3 Fix compiling the ocaml kaleidoscope tutorials
llvm-svn: 125202
2011-02-09 18:32:02 +00:00
Oscar Fuentes 4c6340188a Do not re-test for the existence of pthread.h.
It was causing problems on the MinGW build. See PR8849.

llvm-svn: 122518
2010-12-23 21:27:22 +00:00
Dan Gohman a230754385 Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.

llvm-svn: 119351
2010-11-16 17:28:22 +00:00
Dan Gohman 56f3a4c761 Update examples and documentation to explicitly add basicaa, now that it's
no longer included by default.

llvm-svn: 119169
2010-11-15 18:41:10 +00:00
Oscar Fuentes 889c1e7d80 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Duncan Sands e9da6db67f Convert a bunch of uses of 'bytecode' into 'bitcode'. This
is not everything, but the remaining cases are less trivial.

llvm-svn: 115080
2010-09-29 20:09:55 +00:00
Garrison Venn 851b323866 Removed TracingBrainF from examples Makefile.
llvm-svn: 113970
2010-09-15 14:55:32 +00:00
Michael J. Spencer 93c9b2ea93 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer dc38d36ccb CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner 7b7768a269 fit in 80 columns and don't crash on exit, fixes PR8080
llvm-svn: 113123
2010-09-05 23:09:30 +00:00
Owen Anderson f45ee8128c Remove this from the main tree. I'll host it out of tree.
llvm-svn: 112529
2010-08-30 21:34:26 +00:00
Owen Anderson 75c205e7e2 Add a new example to the LLVM distribution: a trace-based Brainfuck compiler that uses LLVM as its code generator.
llvm-svn: 112465
2010-08-30 07:33:39 +00:00
Mikhail Glushenkov 34c5f1be0d Trailing whitespace.
llvm-svn: 111552
2010-08-19 20:03:53 +00:00
Chris Lattner 0b6dce4ea4 upgrade to use new intrinsics, patch by Dan Hipschman!
llvm-svn: 110735
2010-08-10 21:45:38 +00:00
Duncan Sands 41b4a6b36a Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Eric Christopher 856a682de4 Fix up the ocaml kaleidoscope example as well.
Note that the example currently doesn't appear to work.

llvm-svn: 108121
2010-07-12 02:32:44 +00:00
Chris Lattner 26d7950f8f fix several bugs in the tutorial, patch by Kevin Kelley!
llvm-svn: 106498
2010-06-21 22:51:14 +00:00
Daniel Dunbar a8b941c21b Remove stray semi-colon.
llvm-svn: 106009
2010-06-15 17:47:24 +00:00
Eric Christopher 95f5652e2d Make kaleidoscope use fp add/sub/mul.
Patch by Patrick Flannery!

llvm-svn: 105932
2010-06-14 06:03:16 +00:00
Duncan Sands 211427bda9 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.

llvm-svn: 102865
2010-05-02 15:36:26 +00:00
Nick Lewycky 20f5e974e4 Use provided llvm-defined variables instead of twisting user-controlled knobs.
No visible change.

llvm-svn: 102240
2010-04-24 05:07:24 +00:00
Benjamin Kramer 80178eea6a Fix -Wcast-qual warning.
llvm-svn: 101894
2010-04-20 11:50:37 +00:00
Erick Tryzelaar 77eede5776 Fix the ocaml kaleidoscope tutorial to fix linking external libraries.
llvm-svn: 99151
2010-03-21 23:15:13 +00:00
Erick Tryzelaar dc7e85fec6 Don't always run the ocaml kaleidoscope tutorials.
llvm-svn: 97973
2010-03-08 20:07:32 +00:00
Erick Tryzelaar f11976538e Add OCaml tutorial to the examples.
llvm-svn: 97966
2010-03-08 19:32:27 +00:00
Jeffrey Yasskin 15983e57d6 Roll back r96959 again.
llvm-svn: 96981
2010-02-23 20:53:37 +00:00
Jeffrey Yasskin 3ac46ccdff 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.

llvm-svn: 96959
2010-02-23 18:10:07 +00:00
Garrison Venn 26a18ca97f 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.

llvm-svn: 96949
2010-02-23 16:27:59 +00:00
Jeffrey Yasskin 8a30324e51 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.

llvm-svn: 95896
2010-02-11 19:15:20 +00:00
Garrison Venn b282f60d19 Prevented build on WINDOWS using default make system. Stopped WINDOWS build
at eh llvm/examples level using if check on LLVM_ON_UNIX.

llvm-svn: 95763
2010-02-10 03:38:29 +00:00
Garrison Venn c824adb593 Prevented ExceptionDemo example being built on WINDOWS via if( NOT WIN32 )
check in examples cmake list file. This has NOT been tested.

llvm-svn: 95761
2010-02-10 02:50:08 +00:00
Garrison Venn f4d2f8464d 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).

llvm-svn: 95723
2010-02-09 23:22:43 +00:00
Garrison Venn 8665bcddec Repository access test commit
llvm-svn: 95221
2010-02-03 12:00:02 +00:00
Jeffrey Yasskin 091217be6f 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.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Daniel Dunbar 19c46329dd This example requires RTTI.
llvm-svn: 94398
2010-01-25 00:45:01 +00:00
Chris Lattner 4ba8e5d14f fix PR5649 by making fib use the JIT instead of the interpreter, patch by Perry Lorier!
llvm-svn: 90186
2009-12-01 01:56:27 +00:00
Victor Hernandez f3db915294 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.

llvm-svn: 86311
2009-11-07 00:16:28 +00:00
Victor Hernandez b9f5899779 Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
llvm-svn: 86213
2009-11-06 01:33:24 +00:00
Victor Hernandez 492ed30a32 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.

llvm-svn: 86077
2009-11-05 00:03:03 +00:00
Victor Hernandez de5ad42aa1 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Victor Hernandez c7d6a8327c 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.

llvm-svn: 84292
2009-10-17 00:00:19 +00:00