summaryrefslogtreecommitdiffstats
path: root/llvm/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-1311-27/+22
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 113819
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-1011-22/+27
| | | | llvm-svn: 113632
* fit in 80 columns and don't crash on exit, fixes PR8080Chris Lattner2010-09-051-4/+10
| | | | llvm-svn: 113123
* Remove this from the main tree. I'll host it out of tree.Owen Anderson2010-08-308-848/+0
| | | | llvm-svn: 112529
* Add a new example to the LLVM distribution: a trace-based Brainfuck compiler ↵Owen Anderson2010-08-309-1/+850
| | | | | | that uses LLVM as its code generator. llvm-svn: 112465
* Trailing whitespace.Mikhail Glushenkov2010-08-191-3/+3
| | | | llvm-svn: 111552
* upgrade to use new intrinsics, patch by Dan Hipschman!Chris Lattner2010-08-101-5/+6
| | | | llvm-svn: 110735
* Convert some tab stops into spaces.Duncan Sands2010-07-124-4/+4
| | | | llvm-svn: 108130
* Fix up the ocaml kaleidoscope example as well.Eric Christopher2010-07-124-12/+12
| | | | | | Note that the example currently doesn't appear to work. llvm-svn: 108121
* fix several bugs in the tutorial, patch by Kevin Kelley!Chris Lattner2010-06-214-6/+6
| | | | llvm-svn: 106498
* Remove stray semi-colon.Daniel Dunbar2010-06-151-1/+1
| | | | llvm-svn: 106009
* Make kaleidoscope use fp add/sub/mul.Eric Christopher2010-06-144-12/+12
| | | | | | Patch by Patrick Flannery! llvm-svn: 105932
* Remove the -enable-sjlj-eh option, which doesn't do anything.Duncan Sands2010-05-021-1/+1
| | | | | | | Remove the -enable-eh option which is only used by the JIT, and replace it with -jit-enable-eh. llvm-svn: 102865
* Use provided llvm-defined variables instead of twisting user-controlled knobs.Nick Lewycky2010-04-241-2/+1
| | | | | | No visible change. llvm-svn: 102240
* Fix -Wcast-qual warning.Benjamin Kramer2010-04-201-2/+1
| | | | llvm-svn: 101894
* Fix the ocaml kaleidoscope tutorial to fix linking external libraries.Erick Tryzelaar2010-03-212-2/+2
| | | | llvm-svn: 99151
* Don't always run the ocaml kaleidoscope tutorials.Erick Tryzelaar2010-03-081-2/+5
| | | | llvm-svn: 97973
* Add OCaml tutorial to the examples.Erick Tryzelaar2010-03-0864-1/+3413
| | | | llvm-svn: 97966
* Roll back r96959 again.Jeffrey Yasskin2010-02-233-9/+0
| | | | llvm-svn: 96981
* Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 ofJeffrey Yasskin2010-02-233-0/+9
| | | | | | the examples shared to make sure the shared library keeps working. llvm-svn: 96959
* Modified examples Makefile to only build the ExceptionDemo example for Garrison Venn2010-02-231-1/+6
| | | | | | | | | | | | | 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
* Make Kaleidoscope not link against the interpreter, since that didn'tJeffrey Yasskin2010-02-118-12/+28
| | | | | | | | 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
* Prevented build on WINDOWS using default make system. Stopped WINDOWS buildGarrison Venn2010-02-101-2/+5
| | | | | | at eh llvm/examples level using if check on LLVM_ON_UNIX. llvm-svn: 95763
* Prevented ExceptionDemo example being built on WINDOWS via if( NOT WIN32 )Garrison Venn2010-02-101-1/+4
| | | | | | check in examples cmake list file. This has NOT been tested. llvm-svn: 95761
* Adds a JIT based exception handling example to the examples directory. Garrison Venn2010-02-095-1/+2053
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Repository access test commitGarrison Venn2010-02-031-1/+1
| | | | llvm-svn: 95221
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-278-32/+12
| | | | | | | | | | | | | | | | | | | | | 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
* This example requires RTTI.Daniel Dunbar2010-01-251-0/+1
| | | | llvm-svn: 94398
* fix PR5649 by making fib use the JIT instead of the interpreter, patch by ↵Chris Lattner2009-12-011-1/+9
| | | | | | Perry Lorier! llvm-svn: 90186
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-5/+2
| | | | llvm-svn: 86213
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-051-2/+5
| | | | | | | | | | | | | | | | | | 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
* Remove FreeInst.Victor Hernandez2009-10-261-2/+2
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Autoupgrade malloc insts to malloc calls.Victor Hernandez2009-10-171-1/+6
| | | | | | | | 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
* Make ParallelJIT pthreads linking with CMake slightly less brokenDouglas Gregor2009-10-121-1/+3
| | | | llvm-svn: 83820
* Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it ↵Victor Hernandez2009-09-251-6/+1
| | | | | | causes regressions in the nightly tests. llvm-svn: 82784
* Auto-upgrade malloc instructions to malloc calls.Victor Hernandez2009-09-241-1/+6
| | | | | | Reviewed by Devang Patel. llvm-svn: 82694
* Add examples for Kaleidoscope chapters 2 through 6.Erick Tryzelaar2009-09-2218-3/+3503
| | | | | | | | Conflicts: examples/Makefile llvm-svn: 82574
* Rename Kaleidoscope to show that it's for Chapter 7 of the tutorial.Erick Tryzelaar2009-09-225-9/+25
| | | | llvm-svn: 82573
* Sync c++ kaleidoscope tutorial with test.Erick Tryzelaar2009-09-221-16/+8
| | | | llvm-svn: 82572
* Allocate the module provider in the Kaleidoscope code on the heap, not the ↵Reid Kleckner2009-08-261-35/+33
| | | | | | 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. llvm-svn: 80138
* Make LLVM command-line tools overwrite their output files without -f.Dan Gohman2009-08-251-1/+0
| | | | | | | | | | | | | | | | 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. llvm-svn: 79990
* Fixed double free in Kaleidoscope. Fixes PR4762.Reid Kleckner2009-08-241-3/+4
| | | | llvm-svn: 79896
* eliminate the std::ostream forms of the bitcode writing APIs.Chris Lattner2009-08-232-21/+22
| | | | llvm-svn: 79840
* CMake: LLVMConfig assigns LLVMX86 to the `native' componentOscar Fuentes2009-08-171-1/+1
| | | | | | name. Updated LLVM_LINK_COMPONENTS of Kaleidoscope. llvm-svn: 79219
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-137-71/+85
| | | | llvm-svn: 78948
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-312-2/+2
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move types back to the 2.5 API.Owen Anderson2009-07-293-6/+5
| | | | llvm-svn: 77516
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77347
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-271-5/+5
| | | | llvm-svn: 77247
OpenPOWER on IntegriCloud