summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
Commit message (Collapse)AuthorAge
...
* ExecutionEngine: move createJIT() definition (v2)Dylan Noblesmith2011-05-13
| | | | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131320 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: push TargetMachine creation into clients (v2)Dylan Noblesmith2011-05-13
| | | | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131317 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert ExecutionEngine patches, they either failed to build or broke unit tests.Jakob Stoklund Olesen2011-05-07
| | | | | | Please ensure the build is clean and tests are passing when recommitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131044 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: move createJIT() definitionDylan Noblesmith2011-05-06
| | | | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131027 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine: push TargetMachine creation into clientsDylan Noblesmith2011-05-06
| | | | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appearsChandler Carruth2011-04-28
| | | | | | | | | | | | | a bit more sinister as the memset doesn't do what the constructor does. There seems to be a cleaner solution than a cast here though, instead we can point the memset destination into the union its actually trying to clear. An alternative is to point to the Untyped member of this union. Review appreciated, and if that is cleaner I'm happy to switch. All of these should be functionally equivalent to the original code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130395 91177308-0d34-0410-b5e6-96231b3b80d8
* Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn'tNick Lewycky2011-04-11
| | | | | | | | | | | | | mean that it has to be ConstantArray of ConstantStruct. We might have ConstantAggregateZero, at either level, so don't crash on that. Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so we end up with the two lists appended, each with their "sentinals" on them. Different parts of LLVM treated sentinals differently, so make them all just ignore the single entry and continue on with the rest of the list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129307 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm.global_[cd]tor is defined to be either external, or appending with an arrayNick Lewycky2011-04-08
| | | | | | | | of { i32, void ()* }. Teach the verifier to verify that, deleting copies of checks strewn about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129128 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment to use llvm 2.x syntax.Nick Lewycky2011-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129025 91177308-0d34-0410-b5e6-96231b3b80d8
* Support unregistering exception frames of functions when they are removed.Eric Christopher2011-03-04
| | | | | | | | | Patch by Johannes Schaub! Fixes PR8548 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127047 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded zero arrays.Benjamin Kramer2010-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* PR5207: change APInt::doubleToBits() and APInt::floatToBits() to beJay Foad2010-11-28
| | | | | | static methods that return a new APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120261 91177308-0d34-0410-b5e6-96231b3b80d8
* lli: Add stub -use-mcjit option, which doesn't currently do anything.Daniel Dunbar2010-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119508 91177308-0d34-0410-b5e6-96231b3b80d8
* JIT: More nitty style tweakage, aka territory marking.Daniel Dunbar2010-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118973 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 80-col violation / non-sensicalness.Daniel Dunbar2010-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118958 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the cleanup process of exception information in JIT. Now JITDuncan Sands2010-10-21
| | | | | | | | deregisters registered by it FDE structures allowing consecutive JIT runs to succeed. Patch by Yuri. Fixes PR8285. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117004 91177308-0d34-0410-b5e6-96231b3b80d8
* improve portability to systems that don't have powf/modf (e.g. solaris 9)Chris Lattner2010-05-15
| | | | | | | | patch by Evzen Muller! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103876 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid leaking the memory allocated for GlobalVariables in the interpreter, byJeffrey Yasskin2010-03-27
| | | | | | | freeing that memory when the GV is destroyed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99706 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid leaking argv and env arrays from lli.Jeffrey Yasskin2010-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99589 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-16
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-15
| | | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
* Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.Jeffrey Yasskin2010-02-05
| | | | | | | | | | llc.cpp also defined these flags, meaning that when I linked all of LLVM's libraries into a single shared library, llc crashed on startup with duplicate flag definitions. This patch passes them through the EngineBuilder into JIT::selectTarget(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95390 91177308-0d34-0410-b5e6-96231b3b80d8
* r94686 changed all ModuleProvider parameters to Modules, which made theJeffrey Yasskin2010-02-03
| | | | | | | | | 1-argument ExecutionEngine::create(Module*) ambiguous with the signature that used to be ExecutionEngine::create(ModuleProvider*, defaulted_params). Fixed by removing the 1-argument create(). Fixes PR6221. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95236 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR6028, an assertion failure when an UndefValue ofJay Foad2010-01-15
| | | | | | integer type is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93509 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-05
| | | | | | dereference the type pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92621 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ability to set code model within the execution engine buildersEric Christopher2009-11-17
| | | | | | | and creation interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89151 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86606 91177308-0d34-0410-b5e6-96231b3b80d8
* add interpreter support for indirect goto / blockaddress. The interpreterChris Lattner2009-10-29
| | | | | | | | now correctly runs clang's test/CodeGen/indirect-goto.c. The JIT will abort on it until someone feels compelled to implement this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85488 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the JIT to compile eagerly by default as agreed inJeffrey Yasskin2009-10-27
| | | | | | | | http://llvm.org/PR5184, and beef up the comments to describe what both options do and the risks of lazy compilation in the presence of threads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85295 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR4822: allow module deletion after a function has beenJeffrey Yasskin2009-10-23
| | | | | | | | | | | | | | | compiled. When functions are compiled, they accumulate references in the JITResolver's stub maps. This patch removes those references when the functions are destroyed. It's illegal to destroy a Function when any thread may still try to call its machine code. This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs and fixes a couple "do stuff inside assert()" bugs from r84522. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84975 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the ExecutionEngine automatically remove global mappings on when theirJeffrey Yasskin2009-10-13
| | | | | | | | GlobalValue is destroyed. Function destruction still leaks machine code and can crash on leaked stubs, but this is some progress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83987 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine::clearGlobalMappingsFromModule failed to remove reverseJeffrey Yasskin2009-10-09
| | | | | | | | mappings, which could cause errors and assert-failures. This patch fixes that, adds a test, and refactors the global-mapping-removal code into a single place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83678 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-06
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce a ton of type equality tests to check the typeid (ThroughChris Lattner2009-10-05
| | | | | | | | | the new predicates I added) instead of going through a context and doing a pointer comparison. Besides being cheaper, this allows a smart compiler to turn the if sequence into a switch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
* errorstr can be null, don't unconditionally set it. Only report thatChris Lattner2009-09-23
| | | | | | | | | "the jit has not been linked in" if the interpreter failed. This fixes a unit test failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82601 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EngineBuilder return more error codes, by KS Sreeram.Chris Lattner2009-09-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82600 91177308-0d34-0410-b5e6-96231b3b80d8
* just remove interpreter support for endianness mismatches. This wasChris Lattner2009-08-23
| | | | | | | | really old code from when we were running sparcv9 bc files on x86 (before I ported llvm-gcc 3 to work on x86) :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79871 91177308-0d34-0410-b5e6-96231b3b80d8
* remove use of alloca.hChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79870 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a few DOUTs here and there.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79832 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the std::ostream version of module and type printing.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* To catch bugs like the one fixed inJeffrey Yasskin2009-08-07
| | | | | | | | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That way, if unregistering a mapping fails to actually unregister it, we'll get an assert. Running the jit nightly tests didn't uncover any actual instances of the problem. This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed that too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ExecutionEngine::updateGlobalMapping(GV, NULL) properly remove GV's oldJeffrey Yasskin2009-08-04
| | | | | | | address from the reverse mapping, and add a test that this works now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78127 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate some uses of DOUT, cerr, and getNameStart().Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77145 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify / normalize some uses of Value::getName.Daniel Dunbar2009-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76553 91177308-0d34-0410-b5e6-96231b3b80d8