summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove exception handling support from the old JIT.Rafael Espindola2013-05-071-596/+0
| | | | llvm-svn: 181354
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-5/+5
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-011-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-151-6/+8
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* Revert 165732 for further review.Micah Villmow2012-10-111-8/+6
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-111-6/+8
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Move TargetData to DataLayout.Micah Villmow2012-10-081-2/+2
| | | | llvm-svn: 165402
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-1/+1
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions forEvan Cheng2011-07-181-6/+4
| | | | | | better location welcome). llvm-svn: 135438
* Trailing whitespace.Jim Grosbach2011-03-221-23/+23
| | | | llvm-svn: 128086
* Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs ↵Anton Korobeynikov2011-01-101-5/+5
| | | | | | and fixes here and there. llvm-svn: 123170
* Move getInitialFrameState() to TargetFrameInfoAnton Korobeynikov2010-11-181-1/+2
| | | | llvm-svn: 119754
* remove the dwarf sizing stuff which is now dead, it wasChris Lattner2010-07-221-440/+0
| | | | | | | "yet another" copy of the dwarf EH emission code that was copied, pasted and slightly hacked up. llvm-svn: 109169
* 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. llvm-svn: 101686
* The JIT calls TidyLandingPads to tidy up the landing pads. However, because theBill Wendling2010-04-161-2/+2
| | | | | | | | | | | | | | | | 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. llvm-svn: 101453
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-151-5/+5
| | | | llvm-svn: 101334
* fix these two get the mcsymbol operand instead of imm operand.Chris Lattner2010-03-141-5/+2
| | | | llvm-svn: 98487
* 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. llvm-svn: 98482
* change EH related stuff (other than EH_LABEL) to use MCSymbolChris Lattner2010-03-141-31/+25
| | | | | | | | | | | | | | | | 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. llvm-svn: 98459
* 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. llvm-svn: 98031
* Apply patch from http://llvm.org/bugs/attachment.cgi?id=4136 now that PR5004 isBill Wendling2010-02-161-1/+5
| | | | | | finished. llvm-svn: 96304
* Remove dead store and simplify code.Bill Wendling2009-12-281-5/+4
| | | | llvm-svn: 92191
* Remove isPod() from DenseMapInfo, splitting it out to its ownChris Lattner2009-12-151-1/+0
| | | | | | | | isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91421
* 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-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* remove a dead variable.Chris Lattner2009-09-161-2/+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
* 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-211-28/+18
| | | | | | | | | | 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
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-4/+4
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-4/+5
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-301-87/+87
| | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray llvm-svn: 72631
* On 64bit we may have a personality function which requires 64 bits toNicolas Geoffray2009-02-151-7/+13
| | | | | | be encoded. llvm-svn: 64600
* Implement support for JIT exceptions on X86_64. Relative offsets areNicolas Geoffray2008-11-181-61/+27
| | | | | | | encoded on 32 bytes, and the personality function is not encoded as relative. llvm-svn: 59516
* Unbreak build.Daniel Dunbar2008-10-031-18/+18
| | | | llvm-svn: 57017
* Update the JIT exception writer to better mimic the codegen exception writer.Nicolas Geoffray2008-08-191-11/+10
| | | | | | | Also skip indirect encoding for platforms that ask for one: we direclty write an address, not a pointer to the address. llvm-svn: 54987
* Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. ↵Anton Korobeynikov2008-08-161-40/+39
| | | | | | This makes JIT asmprinter-free. llvm-svn: 54843
* Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman2008-07-011-2/+2
| | | | | | | | | | | | | | | | the need for a flavor operand, and add a new SDNode subclass, LabelSDNode, for use with them to eliminate the need for a label id operand. Change instruction selection to let these label nodes through unmodified instead of creating copies of them. Teach the MachineInstr emitter how to emit a MachineInstr directly from an ISD label node. This avoids the need for allocating SDNodes for the label id and flavor value, as well as SDNodes for each of the post-isel label, label id, and label flavor. llvm-svn: 52943
* Use back() instead of [size()-1].Dan Gohman2008-06-211-2/+2
| | | | llvm-svn: 52600
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Be pessimistic in computing the buffer size when aligning.Nicolas Geoffray2008-04-201-1/+2
| | | | llvm-svn: 50008
* Cosmetic changes, as suggested by Evan. No functionality changes.Nicolas Geoffray2008-04-201-85/+61
| | | | llvm-svn: 49993
* Enable jitting with a known memory size.Nicolas Geoffray2008-04-181-0/+469
| | | | llvm-svn: 49924
* Enable exception handling int JITNicolas Geoffray2008-02-131-0/+636
llvm-svn: 47079
OpenPOWER on IntegriCloud