aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
* Don't rely upon the MCSymbol "isDefined" method to indicate if a label has beenBill Wendling2010-04-181-2/+2
| | | | | | | | emitted or not. The JIT doesn't set that. Look it up in the label location table instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101686 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting changes. No functionality change.Bill Wendling2010-04-181-29/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wcast-qual warnings.Dan Gohman2010-04-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101655 91177308-0d34-0410-b5e6-96231b3b80d8
* The JIT calls TidyLandingPads to tidy up the landing pads. However, because theBill Wendling2010-04-162-4/+8
| | | | | | | | | | | | | | | | | JIT doesn't use the MC back-end asm printer to emit labels that it uses, the section for the MCSymbol is never set. And thus the MCSymbol for the EH label isn't marked as "defined". Because of that, TidyLandingPads removes the needed landing pads from the JIT output. This breaks EH for every JIT program. This is a work-around for this limitation. We pass in the label locations map. If the label has a non-zero value, then it was "emitted" by the JIT and TidyLandingPads shouldn't remove that label. A nicer solution would be to mark the MCSymbol as "used" by the JIT and not rely upon the section being set to determine if it's defined or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101453 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-152-7/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101334 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use DILocation when processing a DebugLoc.Nicolas Geoffray2010-04-141-8/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101294 91177308-0d34-0410-b5e6-96231b3b80d8
* Use twines to simplify calls to report_fatal_error. For code size and ↵Benjamin Kramer2010-04-081-4/+2
| | | | | | readability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100756 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-077-27/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix OProfileJITEventListener build for new DebugLoc.Jeffrey Yasskin2010-04-051-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100461 91177308-0d34-0410-b5e6-96231b3b80d8
* CurFn is only used for relocations. Use EmissionDetails.MF->getFunction() ↵Nicolas Geoffray2010-04-041-1/+2
| | | | | | instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100328 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the code generator (except the JIT) onto the new DebugLocChris Lattner2010-04-021-13/+12
| | | | | | | | | | | | | | | | | representation. This eliminates the 'DILocation' MDNodes for file/line/col tuples from -O0 -g codegen. This remove the old DebugLoc class, making it a typedef for DebugLoc, I'll rename NewDebugLoc next. I didn't update the JIT to use the new apis, so it will continue to work, but be as slow as before. Someone should eventually do this or, better yet, rip out the JIT debug info stuff and build the JIT on top of MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo noticed by Duncan.Torok Edwin2010-03-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99918 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't overwrite previous value, if it succeeded.Torok Edwin2010-03-301-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99886 91177308-0d34-0410-b5e6-96231b3b80d8
* Honour addGlobalMapping() in the interpreter, if it was used to add mappings forTorok Edwin2010-03-301-0/+1
| | | | | | | external Functions (the JIT does honour this). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99885 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid leaking the memory allocated for GlobalVariables in the interpreter, byJeffrey Yasskin2010-03-271-3/+32
| | | | | | | 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-261-13/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99589 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a memory leak in JITDebugRegisterer.Jeffrey Yasskin2010-03-161-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98612 91177308-0d34-0410-b5e6-96231b3b80d8
* fix these two get the mcsymbol operand instead of imm operand.Chris Lattner2010-03-141-5/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98487 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that DBG_LABEL is updated, we can finally make MachineMove Chris Lattner2010-03-141-12/+8
| | | | | | | contain an MCSymbol instead of a label index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98482 91177308-0d34-0410-b5e6-96231b3b80d8
* change EH related stuff (other than EH_LABEL) to use MCSymbolChris Lattner2010-03-142-40/+31
| | | | | | | | | | | | | | | | | | instead of label ID's. This cleans up and regularizes a bunch of code and makes way for future progress. Unfortunately, this pointed out to me that JITDwarfEmitter.cpp is largely copy and paste from DwarfException/MachineModuleInfo and other places. This is very sad and disturbing. :( One major change here is that TidyLandingPads moved from being called in DwarfException::BeginFunction to being called in DwarfException::EndFunction. There should not be any functionality change from doing this, but I'm not an EH expert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98459 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new jump table encoding to indicate jump tables entriesRichard Osborne2010-03-111-0/+4
| | | | | | | are inside the function by the target at the point of use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98255 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce MMI::MappedLabel to MMI::isLabelDeleted,Chris Lattner2010-03-091-6/+4
| | | | | | | | and add a FIXME about how we are eventually going to zap this lookup table once mc world domination is complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR6360. It's easy for a stub's address to escape to user code, so we can'tJeffrey Yasskin2010-03-041-115/+4
| | | | | | | | | | just count references to it from JIT output to decide when to destroy it. This patch waits to destroy the JIT's memory of a stub until the Function it refers to is destroyed. External function stubs and GVIndirectSyms aren't destroyed until the JIT itself is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97737 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5291, in which a SmallPtrSet iterator was held across an insertion intoJeffrey Yasskin2010-03-041-24/+38
| | | | | | | the set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97720 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure JITResolvers don't leave any stubs behind. When a JITResolver wasJeffrey Yasskin2010-03-041-59/+105
| | | | | | | | destroyed, it could leave stubs in the StubToResolverMap, which would confuse the lookup for subsequent lazy compilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97698 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Module functions in place of module providers.Erick Tryzelaar2010-03-021-18/+59
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97608 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-163-10/+10
| | | | | | | | 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
* Apply patch from http://llvm.org/bugs/attachment.cgi?id=4136 now that PR5004 isBill Wendling2010-02-161-1/+5
| | | | | | | finished. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96304 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-153-17/+17
| | | | | | | 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
* Make JIT::runFunction clean up the generated stub function.Jeffrey Yasskin2010-02-121-2/+6
| | | | | | | Patch by Shivram K! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96037 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to create multiple JIT instances at the same time, by removingJeffrey Yasskin2010-02-113-43/+129
| | | | | | | | | | | the global TheJIT and TheJITResolver variables. Lazy compilation is supported by a global map from a stub address to the JITResolver that knows how to compile it. Patch by Olivier Meurant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95837 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
* Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.Jeffrey Yasskin2010-02-054-31/+40
| | | | | | | | | | 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-031-4/+0
| | | | | | | | | 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
* Replace strcpy with memcpy when we have the length around anyway.Benjamin Kramer2010-01-281-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-278-176/+69
| | | | | | | | | | | | | | | | | | | | | | 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
* Add support for target-specific 32-bit custom-lowered Chris Lattner2010-01-261-0/+1
| | | | | | | jump table entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94505 91177308-0d34-0410-b5e6-96231b3b80d8
* make jit jump table emission be based on the EntryKind instead of magic ↵Chris Lattner2010-01-261-18/+27
| | | | | | | | | | variables. JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94501 91177308-0d34-0410-b5e6-96231b3b80d8
* Rearrange handling of jump tables. Highlights:Chris Lattner2010-01-251-16/+22
| | | | | | | | | | | | | | | | | | | | 1. MachineJumpTableInfo is now created lazily for a function the first time it actually makes a jump table instead of for every function. 2. The encoding of jump table entries is now described by the MachineJumpTableInfo::JTEntryKind enum. This enum is determined by the TLI::getJumpTableEncoding() hook, instead of by lots of code scattered throughout the compiler that "knows" that jump table entries are always 32-bits in pic mode (for example). 3. The size and alignment of jump table entries is now calculated based on their kind, instead of at machinefunction creation time. Future work includes using the EntryKind in more places in the compiler, eliminating other logic that "knows" the layout of jump tables in various situations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94470 91177308-0d34-0410-b5e6-96231b3b80d8
* make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.Chris Lattner2010-01-243-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
* Make OProfile support compile again after r93630 removedJeffrey Yasskin2010-01-221-9/+11
| | | | | | | | | DebugLocTuple. Also use an AssertingVH to ensure that MDNodes aren't destroyed while the FilenameCache is using them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94245 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop building RTTI information for *most* llvm libraries. NotableChris Lattner2010-01-223-0/+5
| | | | | | | | | | | | | missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid including DebugInfo.h in AsmPrinter.hDevang Patel2010-01-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace DebugLocTuple with DILocation.Devang Patel2010-01-161-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR6028, an assertion failure when an UndefValue ofJay Foad2010-01-151-2/+16
| | | | | | integer type is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93509 91177308-0d34-0410-b5e6-96231b3b80d8
* "In order to ease automatic bindings generation, it would be helpful if ↵Chris Lattner2010-01-091-17/+17
| | | | | | | | | | boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for." Patch by James Y Knight! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-052-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-053-8/+5
| | | | | | dereference the type pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
* These should probably be errs().David Greene2010-01-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92673 91177308-0d34-0410-b5e6-96231b3b80d8