summaryrefslogtreecommitdiffstats
path: root/llvm/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-sort the #include lines in bindings and examples which I managed toChandler Carruth2015-02-131-2/+2
| | | | | | miss previously. llvm-svn: 229089
* [Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.Lang Hames2015-02-093-26/+26
| | | | | | | | | | | | | | | | This patch refactors a key piece of the Orc APIs: It removes the *::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn respectively, which return instances of the new JITSymbol type. Unlike the old methods, calling findSymbol or findSymbolIn does not cause the symbol to be immediately materialized when found. Instead, the symbol will be materialized if/when the getAddress method is called on the returned JITSymbol. This allows us to query for the existence of symbols without actually materializing them. In the future I expect more information to be attached to the JITSymbol class, for example whether the returned symbol is a weak or strong definition. This will allow us to properly handle weak symbols and multiple definitions. llvm-svn: 228557
* Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and ↵David Blaikie2015-02-083-20/+40
| | | | | | remove an unused parameter. llvm-svn: 228543
* Kaleidoscope-Orc: Extract IRGen work into a utility function.David Blaikie2015-02-081-7/+15
| | | | llvm-svn: 228539
* Constify the Orc Kaleidoscope examples IRGen functions.David Blaikie2015-02-083-66/+66
| | | | llvm-svn: 228537
* [Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.Lang Hames2015-02-083-3/+3
| | | | llvm-svn: 228531
* [Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code andLang Hames2015-02-083-77/+71
| | | | | | further c++ify the Kaleidoscope/Orc tutorials. llvm-svn: 228530
* [CMake] Kaleidoscope-Orc: Update libdeps.NAKAMURA Takumi2015-02-083-3/+6
| | | | llvm-svn: 228524
* Add CMake build support for Orc examples (& fix some clang -Werror buildDavid Blaikie2015-02-088-3/+38
| | | | | | breaks due to unused variables). llvm-svn: 228520
* [Orc][Kaleidoscope] Fix method-name think-o. NFC.Lang Hames2015-02-083-10/+10
| | | | llvm-svn: 228519
* [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.Lang Hames2015-02-063-0/+1366
| | | | | | | | This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making a small set of changes (~75 lines diff) to defer ir-generation for function definitions until functions are actually referenced. llvm-svn: 228466
* [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.Lang Hames2015-02-063-0/+1344
| | | | | | | | This tutorial builds on the initial kaleidoscope/orc tutorial by adding a LazyEmittingLayer to the custom stack. This extra layer defers compilation of modules in the JIT until they are statically referenced. llvm-svn: 228459
* [Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.Lang Hames2015-02-063-0/+1341
| | | | | | | This tutorial demonstrates a very basic custom Orc JIT stack that performs eager compilation: All modules are CodeGen'd immediately upon being added to the JIT. llvm-svn: 228456
* Reorder.NAKAMURA Takumi2015-01-195-5/+5
| | | | llvm-svn: 226419
* [CMake] examples/Kaleidoscope: Prune redundant libdeps.NAKAMURA Takumi2015-01-195-9/+0
| | | | llvm-svn: 226418
* [CMake] Update libdeps in examples/Kaleidoscope/Chapter4.NAKAMURA Takumi2015-01-191-0/+1
| | | | llvm-svn: 226417
* [Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.Lang Hames2015-01-161-44/+38
| | | | | | I forgot to do this for r226308. Thanks to Eric Christopher for the reminder. llvm-svn: 226327
* [Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeatLang Hames2015-01-161-55/+253
| | | | | | | | calls to functions weren't evaluated correctly. Patch by Charlie Turner. Thanks Charlie! llvm-svn: 226308
* Manually specify the folder that Kaleidescope should reside in for ↵Aaron Ballman2015-01-071-0/+1
| | | | | | CMake-produced solutions that care about such things (like MSVC). This takes the Kaleidescope target out of the root solution folder and places it into the Examples folder where it belongs. llvm-svn: 225354
* Kaleidoscope: Value => MetadataDuncan P. N. Exon Smith2015-01-061-1/+1
| | | | llvm-svn: 225320
* cmake: Add Kaleidoscope targetDuncan P. N. Exon Smith2015-01-068-7/+14
| | | | llvm-svn: 225318
* Add a subdirectory in CMake for Chapter 8.Eric Christopher2015-01-061-0/+1
| | | | llvm-svn: 225315
* Once more on the cmake build. nativecodegen->native on the dependencies.Eric Christopher2014-12-085-5/+5
| | | | | | Thanks to Rafael Espindola for testing assistance. llvm-svn: 223678
* Attempt to fix the cmake build by requiring mcjit on the cmakeEric Christopher2014-12-085-0/+5
| | | | | | dependencies for the KS tutorials llvm-svn: 223677
* Fix KS tutorial build failure.Eric Christopher2014-12-085-775/+1059
| | | | | | | make all doesn't build the examples and it was uniquified since last build. llvm-svn: 223675
* Add Chapter 8 to the Kaleidoscope tutorial. This chapter addsEric Christopher2014-12-084-1/+1527
| | | | | | | | | a description of how to add debug information using DWARF and DIBuilder to the language. Thanks to David Blaikie for his assistance with this tutorial. llvm-svn: 223671
* Fix the JIT code for the Kaleidoscope tutorial.Eric Christopher2014-12-084-8/+36
| | | | llvm-svn: 223670
* ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.NAKAMURA Takumi2014-12-031-2/+2
| | | | llvm-svn: 223188
* [CMake] llvm/examples: Update libdeps for unoptimized builds.NAKAMURA Takumi2014-10-312-0/+2
| | | | llvm-svn: 220962
* Add doInitialization/doFinalization to DataLayoutPass.Rafael Espindola2014-09-105-5/+5
| | | | | | | | | | | | | With this a DataLayoutPass can be reused for multiple modules. Once we have doInitialization/doFinalization, it doesn't seem necessary to pass a Module to the constructor. Overall this change seems in line with the idea of making DataLayout a required part of Module. With it the only way of having a DataLayout used is to add it to the Module. llvm-svn: 217548
* Fix configure and make build of llvm examples.Iain Sandoe2014-09-039-9/+9
| | | | | | Replaced link component 'jit' with 'mcjit'. llvm-svn: 217032
* Reinstate "Nuke the old JIT."Eric Christopher2014-09-0223-145/+9
| | | | | | | | Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-3/+2
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola2014-08-199-24/+37
| | | | llvm-svn: 215967
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-0723-9/+145
| | | | | | | | | | | be deleted. This will be reapplied as soon as possible and before the 3.6 branch date at any rate. Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reverts commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 215154
* Nuke the old JIT.Rafael Espindola2014-08-0723-145/+9
| | | | | | | | | I am sure we will be finding bits and pieces of dead code for years to come, but this is a good start. Thanks to Lang Hames for making MCJIT a good replacement! llvm-svn: 215111
* Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EHDan Liew2014-07-221-0/+2
| | | | | | | | to globally be controlled. Individual targets (e.g. ExceptionDemo) can still override this by using LLVM_REQUIRE_RTTI and LLVM_REQUIRE_EH if they need to be compiled with RTTI or exception handling respectively. llvm-svn: 213663
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-147-0/+7
| | | | llvm-svn: 212920
* Try to fix the msvc build.Benjamin Kramer2014-04-291-0/+1
| | | | llvm-svn: 207594
* Fix warnings about an variable only used in asserts.Ahmed Charles2014-03-061-0/+3
| | | | llvm-svn: 203089
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-063-3/+3
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Use DataLayout from the module when easily available.Rafael Espindola2014-02-255-5/+10
| | | | | | | | | | | | | | | | | Eventually DataLayoutPass should go away, but for now that is the only easy way to get a DataLayout in some APIs. This patch only changes the ones that have easy access to a Module. One interesting issue with sometimes using DataLayoutPass and sometimes fetching it from the Module is that we have to make sure they are equivalent. We can get most of the way there by always constructing the pass with a Module. In fact, the pass could be changed to point to an external DataLayout instead of owning one to make this stricter. Unfortunately, the C api passes a DataLayout, so it has to be up to the caller to make sure the pass and the module are in sync. llvm-svn: 202204
* Make DataLayout a plain object, not a pass.Rafael Espindola2014-02-255-5/+5
| | | | | | | Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM don't don't handle passes to also use DataLayout. llvm-svn: 202168
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-1/+1
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Add back r201608, r201622, r201624 and r201625Rafael Espindola2014-02-191-2/+2
| | | | | | | | | | | | | | r201608 made llvm corretly handle private globals with MachO. r201622 fixed a bug in it and r201624 and r201625 were changes for using private linkage, assuming that llvm would do the right thing. They all got reverted because r201608 introduced a crash in LTO. This patch includes a fix for that. The issue was that TargetLoweringObjectFile now has to be initialized before we can mangle names of private globals. This is trivially true during the normal codegen pipeline (the asm printer does it), but LTO has to do it manually. llvm-svn: 201700
* This reverts commit r201625 and r201624.Rafael Espindola2014-02-191-2/+2
| | | | | | | Since r201608 got reverted, it is not safe to use private linkage in these cases until it is committed back. llvm-svn: 201688
* Use PrivateLinkage now that it is safe.Rafael Espindola2014-02-191-2/+2
| | | | | | | Now that llvm's codegen knows to use an 'l' prefix when needed, we can just use PrivateLinkage. llvm-svn: 201624
* Don't try to build ExceptionDemo on ARM.Rafael Espindola2014-02-121-1/+1
| | | | | | The demo uses _Unwind_GetIP which is not available on that platform. llvm-svn: 201261
* [cleanup] Re-sort the examples #include lines with my sort_includesChandler Carruth2014-01-1311-14/+14
| | | | | | script. llvm-svn: 199089
* [cleanup] Fix the includes in the examples for r199082.Chandler Carruth2014-01-1314-14/+14
| | | | llvm-svn: 199087
OpenPOWER on IntegriCloud