summaryrefslogtreecommitdiffstats
path: root/llvm/examples/HowToUseJIT
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-1/+1
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* [opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight2019-02-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc doesn't choke on it, hopefully. Original Message: The FunctionCallee type is effectively a {FunctionType*,Value*} pair, and is a useful convenience to enable code to continue passing the result of getOrInsertFunction() through to EmitCall, even once pointer types lose their pointee-type. Then: - update the CallInst/InvokeInst instruction creation functions to take a Callee, - modify getOrInsertFunction to return FunctionCallee, and - update all callers appropriately. One area of particular note is the change to the sanitizer code. Previously, they had been casting the result of `getOrInsertFunction` to a `Function*` via `checkSanitizerInterfaceFunction`, and storing that. That would report an error if someone had already inserted a function declaraction with a mismatching signature. However, in general, LLVM allows for such mismatches, as `getOrInsertFunction` will automatically insert a bitcast if needed. As part of this cleanup, cause the sanitizer code to do the same. (It will call its functions using the expected signature, however they may have been declared.) Finally, in a small number of locations, callers of `getOrInsertFunction` actually were expecting/requiring that a brand new function was being created. In such cases, I've switched them to Function::Create instead. Differential Revision: https://reviews.llvm.org/D57315 llvm-svn: 352827
* Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."James Y Knight2019-01-311-5/+3
| | | | | | | | | This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791). Seems to run into compilation failures with GCC (but not clang, where I tested it). Reverting while I investigate. llvm-svn: 352800
* [opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight2019-01-311-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FunctionCallee type is effectively a {FunctionType*,Value*} pair, and is a useful convenience to enable code to continue passing the result of getOrInsertFunction() through to EmitCall, even once pointer types lose their pointee-type. Then: - update the CallInst/InvokeInst instruction creation functions to take a Callee, - modify getOrInsertFunction to return FunctionCallee, and - update all callers appropriately. One area of particular note is the change to the sanitizer code. Previously, they had been casting the result of `getOrInsertFunction` to a `Function*` via `checkSanitizerInterfaceFunction`, and storing that. That would report an error if someone had already inserted a function declaraction with a mismatching signature. However, in general, LLVM allows for such mismatches, as `getOrInsertFunction` will automatically insert a bitcast if needed. As part of this cleanup, cause the sanitizer code to do the same. (It will call its functions using the expected signature, however they may have been declared.) Finally, in a small number of locations, callers of `getOrInsertFunction` actually were expecting/requiring that a brand new function was being created. In such cases, I've switched them to Function::Create instead. Differential Revision: https://reviews.llvm.org/D57315 llvm-svn: 352791
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Module::getOrInsertFunction is using C-style vararg instead of variadic ↵Serge Guelton2017-04-111-5/+2
| | | | | | | | | | | templates. From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments. The variadic template is an obvious solution to both issues. Differential Revision: https://reviews.llvm.org/D31070 llvm-svn: 299949
* Prune unused libdeps.NAKAMURA Takumi2016-12-081-1/+0
| | | | llvm-svn: 289060
* Fix some Include What You Use warnings in examples; other minor fixes.Eugene Zelenko2016-05-251-2/+10
| | | | | | Differential revision: http://reviews.llvm.org/D20607 llvm-svn: 270645
* Remove autoconf supportChris Bieneman2016-01-261-15/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* examples: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-11-071-1/+1
| | | | llvm-svn: 252379
* Fix Clang-tidy modernize-use-nullptr warnings in examples and include ↵Hans Wennborg2015-09-291-3/+2
| | | | | | | | | | directories; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13172 llvm-svn: 248811
* llvm/examples: Add missing include according to r230907.NAKAMURA Takumi2015-03-021-0/+1
| | | | llvm-svn: 230926
* Fix configure and make build of llvm examples.Iain Sandoe2014-09-031-1/+1
| | | | | | Replaced link component 'jit' with 'mcjit'. llvm-svn: 217032
* Reinstate "Nuke the old JIT."Eric Christopher2014-09-022-3/+0
| | | | | | | | Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
* Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola2014-08-191-2/+3
| | | | llvm-svn: 215967
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-072-0/+3
| | | | | | | | | | | 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-072-3/+0
| | | | | | | | | 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
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-141-0/+1
| | | | llvm-svn: 212920
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-101-1/+8
| | | | llvm-svn: 196908
* Update the examples for the new header file locations.Chandler Carruth2013-01-021-6/+6
| | | | | | | Sorry for the fallout here, I forgot the examples aren't built by default any more. llvm-svn: 171371
* Sort the #include lines of the examples/... tree.Chandler Carruth2012-12-041-4/+4
| | | | llvm-svn: 169249
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-291-3/+3
| | | | | | | | | | | | | | | | | 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. llvm-svn: 159421
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-1/+1
| | | | | | These are strictly utilities for registering targets and components. llvm-svn: 138450
* Modify comment.Johnny Chen2011-06-091-1/+1
| | | | llvm-svn: 132800
* Have the JIT tutorial use IRBuilder for the IR.Eric Christopher2011-06-091-8/+17
| | | | | | Patch by Jake Waskett! llvm-svn: 132770
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-131-2/+2
| | | | | | | | | | 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-101-2/+2
| | | | llvm-svn: 113632
* Roll back r96959 again.Jeffrey Yasskin2010-02-231-3/+0
| | | | llvm-svn: 96981
* Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 ofJeffrey Yasskin2010-02-231-0/+3
| | | | | | the examples shared to make sure the shared library keeps working. llvm-svn: 96959
* Repository access test commitGarrison Venn2010-02-031-1/+1
| | | | llvm-svn: 95221
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-1/+0
| | | | | | | | | | | | | | | | | | | | | 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
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-8/+10
| | | | llvm-svn: 78948
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-2/+2
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Add EngineBuilder to ExecutionEngine in favor of the five optional argument ↵Reid Kleckner2009-07-181-2/+1
| | | | | | | | EE::create(). Also a test commit. llvm-svn: 76276
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-2/+2
| | | | llvm-svn: 75703
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-011-1/+1
| | | | llvm-svn: 74640
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-011-1/+4
| | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. llvm-svn: 74614
* make sure that JIT examples link in their appropriate target.Chris Lattner2009-06-171-0/+4
| | | | llvm-svn: 73613
* Another attempt at fixing PR2975.Torok Edwin2009-04-071-0/+4
| | | | | | Types can have references to eachother, so we can't just call destroy on them. llvm-svn: 68523
* revert r68457, its crashing in make check.Torok Edwin2009-04-061-4/+0
| | | | llvm-svn: 68459
* fix (part of) memory leak on shutdown. See PR2975.Torok Edwin2009-04-061-0/+4
| | | | llvm-svn: 68457
* CMake: use add_llvm_example for HowToUseJIT.Oscar Fuentes2008-10-221-1/+1
| | | | llvm-svn: 57944
* CMake: Builds all examples. Corrected name of CBackend target.Oscar Fuentes2008-09-261-0/+5
| | | | llvm-svn: 56682
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. llvm-svn: 55263
* Remove asmprinters from examples by default. This reduces their size by ~5%Anton Korobeynikov2008-08-171-1/+1
| | | | llvm-svn: 54890
* Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner2008-08-171-1/+1
| | | | | | | | | | | | | | | | | returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. llvm-svn: 54873
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-161-1/+1
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-5/+5
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* remove attributions from examples.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45420
* remove attributions from the rest of the llvm makefiles.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45416
OpenPOWER on IntegriCloud