summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an option that allows one to "decode" the LSDA.Bill Wendling2011-06-171-3/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LSDA is a bit difficult for the non-initiated to read. Even with comments, it's not always clear what's going on. This wraps the ASM streamer in a class that retains the LSDA and then emits a human-readable description of what's going on in it. So instead of having to make sense of: Lexception1: .byte 255 .byte 155 .byte 168 .space 1 .byte 3 .byte 26 Lset0 = Ltmp7-Leh_func_begin1 .long Lset0 Lset1 = Ltmp812-Ltmp7 .long Lset1 Lset2 = Ltmp913-Leh_func_begin1 .long Lset2 .byte 3 Lset3 = Ltmp812-Leh_func_begin1 .long Lset3 Lset4 = Leh_func_end1-Ltmp812 .long Lset4 .long 0 .byte 0 .byte 1 .byte 0 .byte 2 .byte 125 .long __ZTIi@GOTPCREL+4 .long __ZTIPKc@GOTPCREL+4 you can read this instead: ## Exception Handling Table: Lexception1 ## @LPStart Encoding: omit ## @TType Encoding: indirect pcrel sdata4 ## @TType Base: 40 bytes ## @CallSite Encoding: udata4 ## @Action Table Size: 26 bytes ## Action 1: ## A throw between Ltmp7 and Ltmp812 jumps to Ltmp913 on an exception. ## For type(s): __ZTIi@GOTPCREL+4 __ZTIPKc@GOTPCREL+4 ## Action 2: ## A throw between Ltmp812 and Leh_func_end1 does not have a landing pad. llvm-svn: 133286
* Don't hardcode the %reg format in the streamer.Rafael Espindola2011-06-021-6/+10
| | | | llvm-svn: 132451
* Use the dwarf->llvm mapping to print register names in the cfiRafael Espindola2011-05-301-5/+25
| | | | | | | | directives. Fixes PR9826. llvm-svn: 132317
* Add a parameter to the Win64 EH section getters to get a section with aCharles Davis2011-05-271-1/+3
| | | | | | | | | | suffix (e.g. .xdata$myfunc). The suffix part isn't implemented yet, but I'll get to it in the next patch. Fix up all callers of the affected functions. Make them pass said suffix to the function. llvm-svn: 132205
* Add tests for .seh_setframe and .seh_handlerdata parsing. Fix issues withCharles Davis2011-05-251-0/+9
| | | | | | | | | | them. I had to add a special SwitchSectionNoChange method to MCStreamer just for .seh_handlerdata. If this isn't OK, please let me know, and I'll find some other way to fix .seh_handlerdata streaming. llvm-svn: 132084
* Add methods to parse the SEH directives to the COFFAsmParser. Implement someCharles Davis2011-05-221-2/+2
| | | | | | | of them, particularly the ones that don't take arguments. Also implement .seh_proc and .seh_handler. llvm-svn: 131866
* Add missing leading \t when printing .cfi_def_cfa in the asmstreamer.Jim Grosbach2011-05-201-1/+1
| | | | llvm-svn: 131755
* Now that they're implemented, make the Win64 EH MCAsmStreamer methods callCharles Davis2011-05-201-0/+26
| | | | | | super. llvm-svn: 131743
* Misc code refactorings:Rafael Espindola2011-05-191-1/+1
| | | | | | | * Remove unnecessary arguments now that ForceExpAbs is a method. * Use ForceExpAbs in EmitAbsValue. llvm-svn: 131683
* Implement the Win64 EH prolog instruction methods on the base MCStreamer.Charles Davis2011-05-191-10/+10
| | | | | | I had to change the API slightly to avoid overloading issues. llvm-svn: 131666
* Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) MakeCharles Davis2011-05-191-21/+31
| | | | | | | | | ours compatible with GAS. In retrospect, I should have emailed binutils about this earlier. Thanks to Kai Tietz for pointing out that GAS already had SEH directives. llvm-svn: 131652
* Remove comments as Chris requested.Charles Davis2011-05-181-48/+12
| | | | llvm-svn: 131590
* Fix an obvious typo in r131572.Cameron Zwarich2011-05-181-2/+2
| | | | llvm-svn: 131579
* Add some more Win64 EH directives:Charles Davis2011-05-181-0/+36
| | | | | | | | | | | | | - StartChained and EndChained delimit a chained unwind area, which can contain additional operations to be undone if an exception occurs inside of it. - UnwindOnly declares that this function doesn't handle any exceptions. If it has a handler, it's an unwind handler instead of an exception handler. - Lsda declares the location and size of the LSDA, which in the Win64 EH scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the LSDA; it's used by the Language-Specific Handler (the "Personality Function" from DWARF). llvm-svn: 131572
* Implement the Win64 EH directive methods for the assembly language streamer.Charles Davis2011-05-181-0/+77
| | | | | | | | | GAS has no such directives (not even mingw-w64 GAS has them), so I took creative license with their names in assembly. I prefixed them all with "w64_" to avoid namespace collisions, for example. If I discover that GAS has taken a different approach, I'll change ours to match. llvm-svn: 131525
* sets bit 0 of the function address of thumb function in .symtabRafael Espindola2011-05-161-1/+2
| | | | | | | | | | ("T is 1 if the target symbol S has type STT_FUNC and the symbol addresses a Thumb instruction ;it is 0 otherwise." from "ELF for the ARM Architecture" 4.7.1.2) Patch by Koan-Sin Tan! llvm-svn: 131406
* Add CFIStartSections to the asm printer. Add an assert that at leastRafael Espindola2011-05-101-0/+19
| | | | | | one of the sections is created. llvm-svn: 131124
* Factor some code into a new EmitFrames method.Rafael Espindola2011-05-101-2/+2
| | | | llvm-svn: 131119
* GCC uses a different encoding of pointers in the FDE when usingRafael Espindola2011-05-011-0/+3
| | | | | | -fno-dwarf2-cfi-asm. Implement the same behavior. llvm-svn: 130637
* Simplify the handling of pcrel relocations on ELF. Now we do the right thingRafael Espindola2011-05-011-3/+2
| | | | | | | | | | for all symbol differences and can drop the old EmitPCRelSymbolValue method. This also make getExprForFDESymbol on ELF equal to the one on MachO, and it can be made non-virtual. llvm-svn: 130634
* Revert the previous patch while I figure out how to make llvm-gccRafael Espindola2011-04-301-3/+0
| | | | | | less agressive about disabling cfi on linux :-( llvm-svn: 130626
* Enable CFI on OS X.Rafael Espindola2011-04-301-0/+3
| | | | | | | | | | | | | | | Currently the output should be almost identical to the one produced by CodeGen to make the transition easier. The only two differences I know of are: * Some files get an extra advance loc of size 0. This will be fixed when relaxations are enabled. * The optimization of declaring an EH symbol as an external variable is not implemented. This is a subset of adding the nounwind attribute, so we if really this at -O0 we should probably do it at the IL level. llvm-svn: 130623
* Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamerRafael Espindola2011-04-301-3/+31
| | | | | | | is a bit ugly, but doing it on the base MCStreamer would be redundant with the object streamer which does it using SD. llvm-svn: 130611
* Add all the plumbing needed for MC to expand cfi to the old tables inRafael Espindola2011-04-301-4/+44
| | | | | | | the final assembly. It is the same technique used when targeting assemblers that don't support .loc. llvm-svn: 130587
* Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.Rafael Espindola2011-04-301-0/+11
| | | | llvm-svn: 130585
* Implement MCAsmStreamer::EmitCFIDefCfa.Rafael Espindola2011-04-291-1/+4
| | | | llvm-svn: 130543
* Hoist MCLineEntry construction AsmPrinter so that anyone who derives from ↵Devang Patel2011-04-291-3/+0
| | | | | | | | AsmPrinter can have line number entries. PR 9810 llvm-svn: 130518
* Factor a bit of code to MCStreamer::EmitLabel. Keep track of the lastRafael Espindola2011-04-271-3/+1
| | | | | | | | | | | | non private symbol. This will be use for handling foo: .cfi_startproc ... On OS X where we have to create a foo.eh symbol. llvm-svn: 130305
* Remove unused argument.Rafael Espindola2011-04-211-6/+6
| | | | llvm-svn: 129955
* Reduce clutter in asm output. Do not emit source location as comment for ↵Devang Patel2011-04-181-3/+11
| | | | | | each instruction. llvm-svn: 129715
* Be consistent about being virtual and returning void in the cfi methods.Rafael Espindola2011-04-121-40/+64
| | | | | | Implement the ones that were missing in the asm streamer. llvm-svn: 129413
* Fix whitespace.NAKAMURA Takumi2011-03-271-2/+2
| | | | llvm-svn: 128370
* Preliminary support for ARM frame save directives emission via MI flags.Anton Korobeynikov2011-03-051-0/+34
| | | | | | | This is just very first approximation how the stuff should be done (e.g. ARM-only for now). More to follow. llvm-svn: 127101
* Some first rudimentary support for ARM EHABI: print exception table in "text ↵Anton Korobeynikov2011-03-051-0/+31
| | | | | | mode". llvm-svn: 127099
* Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.Cameron Zwarich2011-02-251-6/+0
| | | | llvm-svn: 126488
* Enable DebugInfo support for COFF object files.Devang Patel2011-02-241-0/+6
| | | | | | Patch by Nathan Jeffords! llvm-svn: 126425
* Add support for pushsection and popsection. Patch by Joerg Sonnenberger.Rafael Espindola2011-02-161-12/+8
| | | | llvm-svn: 125629
* Use common style for .cfi directivesAnton Korobeynikov2011-01-141-7/+7
| | | | llvm-svn: 123472
* Add comment about Thumb2 fixup comments being completely bogus.Evan Cheng2011-01-131-1/+3
| | | | llvm-svn: 123411
* Relax an assertion. On archs like ARM, an immediate field may be scattered. ↵Evan Cheng2011-01-131-2/+6
| | | | | | So it's possible for some bits of every 8 bits to be encoded already, and the rest still needs to be fixed up. llvm-svn: 123403
* Add support for .cfi_lsda.Rafael Espindola2010-12-271-4/+4
| | | | llvm-svn: 122584
* Add support for the same encodings of the personality function that gnu asRafael Espindola2010-12-271-4/+5
| | | | | | supports. llvm-svn: 122577
* Add missing standard headers. Patch by Joerg Sonnenberger!Nick Lewycky2010-12-191-0/+1
| | | | llvm-svn: 122193
* MC: Move target specific fixup info descriptors to TargetAsmBackend instead ofDaniel Dunbar2010-12-161-2/+3
| | | | | | | the MCCodeEmitter, which seems like a better organization. - Also, cleaned up some magic constants while in the area. llvm-svn: 121953
* MC: Make TargetAsmBackend available to the AsmStreamer.Daniel Dunbar2010-12-161-7/+11
| | | | | | - Treaty talks on the non-proliferation of MC objects broke down. llvm-svn: 121949
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-39/+24
| | | | llvm-svn: 121471
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-24/+39
| | | | llvm-svn: 121461
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-39/+24
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). llvm-svn: 121434
* Second try at making direct object emission produce the same resultsRafael Espindola2010-12-061-34/+0
| | | | | | | as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc bootstrap on darwin10 using darwin9's assembler and linker. llvm-svn: 121006
* There are two reasons why we might want to useRafael Espindola2010-12-041-4/+31
| | | | | | | | | | | | | | | | foo = a - b .long foo instead of just .long a - b First, on darwin9 64 bits the assembler produces the wrong result. Second, if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not consider a - b to be a constant but will if the dummy foo is created. Split how we handle these cases. The first one is something MC should take care of. The second one has to be handled by the caller. llvm-svn: 120889
OpenPOWER on IntegriCloud