summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* s/DebugLoc.CompileUnit/DebugLoc.Scope/gDevang Patel2009-10-131-1/+1
| | | | | | s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g llvm-svn: 84054
* Keep track of stubs that are created. This fixes PR5162 and probably PR4822 andJeffrey Yasskin2009-10-132-11/+9
| | | | | | 4406. Patch by Nick Lewycky! llvm-svn: 84032
* Make the ExecutionEngine automatically remove global mappings on when theirJeffrey Yasskin2009-10-131-30/+47
| | | | | | | GlobalValue is destroyed. Function destruction still leaks machine code and can crash on leaked stubs, but this is some progress. llvm-svn: 83987
* ExecutionEngine::clearGlobalMappingsFromModule failed to remove reverseJeffrey Yasskin2009-10-091-16/+19
| | | | | | | 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. llvm-svn: 83678
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-061-1/+1
| | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
* Update processDebugLoc() to handle requests to process debug info, before ↵Devang Patel2009-10-061-9/+11
| | | | | | and after emitting instructions. llvm-svn: 83364
* Fix http://llvm.org/PR5116 by rolling back r60822. This passes `make unittestsJeffrey Yasskin2009-10-061-1/+1
| | | | | | check-lit` on both x86-64 Linux and x86-32 Darwin. llvm-svn: 83353
* strength reduce a ton of type equality tests to check the typeid (ThroughChris Lattner2009-10-052-22/+20
| | | | | | | | 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. llvm-svn: 83297
* Fix compile error as debug interface changed.Nick Lewycky2009-09-301-6/+4
| | | | | | | By the way, this code is buggy. You can't keep a map<MDNode *, something> because the MDNode may be destroyed and reused for something else. llvm-svn: 83141
* Fix a struct/class mismatch.Benjamin Kramer2009-09-231-1/+1
| | | | llvm-svn: 82622
* errorstr can be null, don't unconditionally set it. Only report thatChris Lattner2009-09-231-6/+9
| | | | | | | | "the jit has not been linked in" if the interpreter failed. This fixes a unit test failure. llvm-svn: 82601
* Make EngineBuilder return more error codes, by KS Sreeram.Chris Lattner2009-09-231-13/+22
| | | | llvm-svn: 82600
* Use Compiler.h macro instead of __attribute__.Daniel Dunbar2009-09-221-1/+1
| | | | llvm-svn: 82532
* Update cmake.Xerxes Ranby2009-09-211-0/+1
| | | | llvm-svn: 82449
* Register the MachineModuleInfo for the ARM JIT, and update JITDwarfEmitter toDaniel Dunbar2009-09-211-1/+5
| | | | | | assert if the setModuleInfo hasn't been called. llvm-svn: 82441
* Implement the JIT side of the GDB JIT debugging interface. To enable thisReid Kleckner2009-09-207-17/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature, either build the JIT in debug mode to enable it by default or pass -jit-emit-debug to lli. Right now, the only debug information that this communicates to GDB is call frame information, since it's already being generated to support exceptions in the JIT. Eventually, when DWARF generation isn't tied so tightly to AsmPrinter, it will be easy to push that information to GDB through this interface. Here's a step-by-step breakdown of how the feature works: - The JIT generates the machine code and DWARF call frame info (.eh_frame/.debug_frame) for a function into memory. - The JIT copies that info into an in-memory ELF file with a symbol for the function. - The JIT creates a code entry pointing to the ELF buffer and adds it to a linked list hanging off of a global descriptor at a special symbol that GDB knows about. - The JIT calls a function marked noinline that GDB knows about and has put an internal breakpoint in. - GDB catches the breakpoint and reads the global descriptor to look for new code. - When sees there is new code, it reads the ELF from the inferior's memory and adds it to itself as an object file. - The JIT continues, and the next time we stop the program, we are able to produce a proper backtrace. Consider running the following program through the JIT: #include <stdio.h> void baz(short z) { long w = z + 1; printf("%d, %x\n", w, *((int*)NULL)); // SEGFAULT here } void bar(short y) { int z = y + 1; baz(z); } void foo(char x) { short y = x + 1; bar(y); } int main(int argc, char** argv) { char x = 1; foo(x); } Here is a backtrace before this patch: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x2aaaabdfbd10 (LWP 25476)] 0x00002aaaabe7d1a8 in ?? () (gdb) bt #0 0x00002aaaabe7d1a8 in ?? () #1 0x0000000000000003 in ?? () #2 0x0000000000000004 in ?? () #3 0x00032aaaabe7cfd0 in ?? () #4 0x00002aaaabe7d12c in ?? () #5 0x00022aaa00000003 in ?? () #6 0x00002aaaabe7d0aa in ?? () #7 0x01000002abe7cff0 in ?? () #8 0x00002aaaabe7d02c in ?? () #9 0x0100000000000001 in ?? () #10 0x00000000014388e0 in ?? () #11 0x00007fff00000001 in ?? () #12 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70, F=0x14024e0, ArgValues=@0x7fffffffe050) at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395 #13 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain (this=0x1405b70, Fn=0x14024e0, argv=@0x13f06f8, envp=0x7fffffffe3b0) at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377 #14 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe398, envp=0x7fffffffe3b0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208 And a backtrace after this patch: Program received signal SIGSEGV, Segmentation fault. 0x00002aaaabe7d1a8 in baz () (gdb) bt #0 0x00002aaaabe7d1a8 in baz () #1 0x00002aaaabe7d12c in bar () #2 0x00002aaaabe7d0aa in foo () #3 0x00002aaaabe7d02c in main () #4 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70, F=0x14024e0, ArgValues=...) at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395 #5 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain (this=0x1405b70, Fn=0x14024e0, argv=..., envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377 #6 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe3a8, envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208 llvm-svn: 82418
* Stop using alloca.Nick Lewycky2009-09-181-17/+14
| | | | llvm-svn: 82225
* Some platforms may need malloc.h for alloca.Daniel Dunbar2009-09-171-3/+6
| | | | llvm-svn: 82100
* remove a dead variable.Chris Lattner2009-09-162-3/+0
| | | | llvm-svn: 81985
* Fix PR4865. This syncs up the JIT's DWARF emitter with what's in theBill Wendling2009-09-091-20/+21
| | | | | | | 'DwarfException.cpp' file, which changed how CIEs were emitted, the sizes of some fields, etc. llvm-svn: 81295
* Improve JIT error message for users crazy enough to use -march with JIT, andDaniel Dunbar2009-09-081-2/+4
| | | | | | mention -version in messages about missing targets. llvm-svn: 81272
* Fix PR4845: r77946 completely broke x86_64 Darwin (or any situation where theEvan Cheng2009-09-021-10/+32
| | | | | | | | desired triplet is a sub-target, e.g. thumbv7 vs. arm host). Reverting the patch isn't quite right either since the previous behavior does not allow the triplet to be overridden with -march. llvm-svn: 80742
* Fix OProfile support after r80406 changed the DebugInfo interface fromJeffrey Yasskin2009-08-291-3/+3
| | | | | | GlobalVariables to MDNodes. llvm-svn: 80411
* Initialize the PoisonMemory member before initializingDan Gohman2009-08-271-7/+7
| | | | | | | | | members that call methods that read the PoisonMemory member. This fixes potential spurious (though probably otherwise harmless) poising of unused memory, and fixes the associated valgrind error. llvm-svn: 80192
* Fix PR4772 ARM JIT.GlobalInFuction unittest by explicitly initialize MMI Xerxes Ranby2009-08-251-1/+1
| | | | | | | | | to 0 during JITEmitter constructor. Modified: lib/ExecutionEngine/JIT/JITEmitter.cpp llvm-svn: 79982
* just remove interpreter support for endianness mismatches. This wasChris Lattner2009-08-231-12/+0
| | | | | | | really old code from when we were running sparcv9 bc files on x86 (before I ported llvm-gcc 3 to work on x86) :) llvm-svn: 79871
* remove use of alloca.hChris Lattner2009-08-231-5/+7
| | | | llvm-svn: 79870
* remove some uses of llvm/Support/Streams.hChris Lattner2009-08-232-5/+4
| | | | llvm-svn: 79842
* remove a few DOUTs here and there.Chris Lattner2009-08-234-49/+49
| | | | llvm-svn: 79832
* remove the std::ostream version of module and type printing.Chris Lattner2009-08-232-6/+6
| | | | llvm-svn: 79823
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-232-46/+44
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-41/+41
| | | | llvm-svn: 79763
* Fix a bug where the DWARF emitter in the JIT was not initializing alignmentReid Kleckner2009-08-212-28/+22
| | | | | | | | | | bytes. libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it doesn't like it. Also make the JIT memory manager to initialize it's memory to garbage in debug mode, so that it's easier to find bugs like these in the future. llvm-svn: 79674
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-134-50/+65
| | | | llvm-svn: 78948
* This void is implicit in C++.Dan Gohman2009-08-124-6/+6
| | | | llvm-svn: 78848
* SjLj based exception handling unwinding support. This patch is nasty, brutishJim Grosbach2009-08-111-4/+4
| | | | | | | | | | | | | and short. Well, it's kinda short. Definitely nasty and brutish. The front-end generates the register/unregister calls into the SjLj runtime, call-site indices and landing pad dispatch. The back end fills in the LSDA with the call-site information provided by the front end. Catch blocks are not yet implemented. Built on Darwin and verified no llvm-core "make check" regressions. llvm-svn: 78625
* MSVC warning fixes; patch by Stein Roger!Daniel Dunbar2009-08-071-0/+11
| | | | llvm-svn: 78405
* To catch bugs like the one fixed inJeffrey Yasskin2009-08-071-13/+18
| | | | | | | | | | | | | 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. llvm-svn: 78400
* Fix a bunch of namespace pollution.Dan Gohman2009-08-071-0/+2
| | | | llvm-svn: 78363
* Make ExecutionEngine::updateGlobalMapping(GV, NULL) properly remove GV's oldJeffrey Yasskin2009-08-041-1/+1
| | | | | | address from the reverse mapping, and add a test that this works now. llvm-svn: 78127
* No really, it's unused.Daniel Dunbar2009-08-041-2/+1
| | | | llvm-svn: 78047
* llvm_report_error already prints "LLVM ERROR:". So stop reporting errors ↵Benjamin Kramer2009-08-032-2/+2
| | | | | | like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:". llvm-svn: 77971
* Remove now unused arguments from TargetRegistry::lookupTarget.Daniel Dunbar2009-08-031-4/+1
| | | | llvm-svn: 77950
* Pass target triple string in to TargetMachine constructor.Daniel Dunbar2009-08-031-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This is not just a matter of passing in the target triple from the module; currently backends are making decisions based on the build and host architecture. The goal is to migrate to making these decisions based off of the triple (in conjunction with the feature string). Thus most clients pass in the target triple, or the host triple if that is empty. This has one important change in the way behavior of the JIT and llc. For the JIT, it was previously selecting the Target based on the host (naturally), but it was setting the target machine features based on the triple from the module. Now it is setting the target machine features based on the triple of the host. For LLC, -march was previously only used to select the target, the target machine features were initialized from the module's triple (which may have been empty). Now the target triple is taken from the module, or the host's triple is used if that is empty. Then the triple is adjusted to match -march. The take away is that -march for llc is now used in conjunction with the host triple to initialize the subtarget. If users want more deterministic behavior from llc, they should use -mtriple, or set the triple in the input module. llvm-svn: 77946
* Fix the build for people with oprofile installed.Nick Lewycky2009-08-021-3/+4
| | | | llvm-svn: 77914
* In TrimAllocationToSize, if a block is below the minimum allocation size,Nicolas Geoffray2009-07-291-1/+4
| | | | | | | there is no new block added to the free list. Therefore on the next startFunctionBody call, a new slab must be allocated. llvm-svn: 77520
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+1
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77494
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-271-3/+3
| | | | llvm-svn: 77247
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-262-11/+11
| | | | llvm-svn: 77152
OpenPOWER on IntegriCloud