aboutsummaryrefslogtreecommitdiff
path: root/llvm/examples/HowToUseJIT
AgeCommit message (Collapse)AuthorFilesLines
2019-08-15[llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere1-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
2019-02-01[opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight1-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
2019-01-31Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."James Y Knight1-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
2019-01-31[opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight1-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
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-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
2017-04-11Module::getOrInsertFunction is using C-style vararg instead of variadic ↵Serge Guelton1-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
2016-12-08Prune unused libdeps.NAKAMURA Takumi1-1/+0
llvm-svn: 289060
2016-05-25Fix some Include What You Use warnings in examples; other minor fixes.Eugene Zelenko1-2/+10
Differential revision: http://reviews.llvm.org/D20607 llvm-svn: 270645
2016-01-26Remove autoconf supportChris Bieneman1-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
2015-11-07examples: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith1-1/+1
llvm-svn: 252379
2015-09-29Fix Clang-tidy modernize-use-nullptr warnings in examples and include ↵Hans Wennborg1-3/+2
directories; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13172 llvm-svn: 248811
2015-03-02llvm/examples: Add missing include according to r230907.NAKAMURA Takumi1-0/+1
llvm-svn: 230926
2014-09-03Fix configure and make build of llvm examples.Iain Sandoe1-1/+1
Replaced link component 'jit' with 'mcjit'. llvm-svn: 217032
2014-09-02Reinstate "Nuke the old JIT."Eric Christopher2-3/+0
Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
2014-08-19Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola1-2/+3
llvm-svn: 215967
2014-08-07Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2-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
2014-08-07Nuke the old JIT.Rafael Espindola2-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
2014-07-14[CMake] Update libdeps.NAKAMURA Takumi1-0/+1
llvm-svn: 212920
2013-12-10[CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi1-1/+8
llvm-svn: 196908
2013-01-02Update the examples for the new header file locations.Chandler Carruth1-6/+6
Sorry for the fallout here, I forgot the examples aren't built by default any more. llvm-svn: 171371
2012-12-04Sort the #include lines of the examples/... tree.Chandler Carruth1-4/+4
llvm-svn: 169249
2012-06-29Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth1-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
2011-08-24Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng1-1/+1
These are strictly utilities for registering targets and components. llvm-svn: 138450
2011-06-09Modify comment.Johnny Chen1-1/+1
llvm-svn: 132800
2011-06-09Have the JIT tutorial use IRBuilder for the IR.Eric Christopher1-8/+17
Patch by Jake Waskett! llvm-svn: 132770
2010-09-13Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer1-2/+2
This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 113819
2010-09-10CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer1-2/+2
llvm-svn: 113632
2010-02-23Roll back r96959 again.Jeffrey Yasskin1-3/+0
llvm-svn: 96981
2010-02-23Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 ofJeffrey Yasskin1-0/+3
the examples shared to make sure the shared library keeps working. llvm-svn: 96959
2010-02-03Repository access test commitGarrison Venn1-1/+1
llvm-svn: 95221
2010-01-27Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin1-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
2009-08-13Push LLVMContexts through the IntegerType APIs.Owen Anderson1-8/+10
llvm-svn: 78948
2009-07-24Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson1-2/+2
thanks to contexts-on-types. More to come. llvm-svn: 77011
2009-07-18Add EngineBuilder to ExecutionEngine in favor of the five optional argument ↵Reid Kleckner1-2/+1
EE::create(). Also a test commit. llvm-svn: 76276
2009-07-14Move EVER MORE stuff over to LLVMContext.Owen Anderson1-2/+2
llvm-svn: 75703
2009-07-01Hold the LLVMContext by reference rather than by pointer.Owen Anderson1-1/+1
llvm-svn: 74640
2009-07-01Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson1-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
2009-06-17make sure that JIT examples link in their appropriate target.Chris Lattner1-0/+4
llvm-svn: 73613
2009-04-07Another attempt at fixing PR2975.Torok Edwin1-0/+4
Types can have references to eachother, so we can't just call destroy on them. llvm-svn: 68523
2009-04-06revert r68457, its crashing in make check.Torok Edwin1-4/+0
llvm-svn: 68459
2009-04-06fix (part of) memory leak on shutdown. See PR2975.Torok Edwin1-0/+4
llvm-svn: 68457
2008-10-22CMake: use add_llvm_example for HowToUseJIT.Oscar Fuentes1-1/+1
llvm-svn: 57944
2008-09-26CMake: Builds all examples. Corrected name of CBackend target.Oscar Fuentes1-0/+5
llvm-svn: 56682
2008-08-23Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner1-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
2008-08-17Remove asmprinters from examples by default. This reduces their size by ~5%Anton Korobeynikov1-1/+1
llvm-svn: 54890
2008-08-17Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner1-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
2008-05-16API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif1-1/+1
Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
2008-04-06API changes for class Use size reduction, wave 1.Gabor Greif1-5/+5
Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
2007-12-29remove attributions from examples.Chris Lattner1-2/+2
llvm-svn: 45420
2007-12-29remove attributions from the rest of the llvm makefiles.Chris Lattner1-2/+2
llvm-svn: 45416