summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-201-1/+0
| | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. llvm-svn: 135611
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-201-2/+15
| | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-181-2/+3
| | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. llvm-svn: 135424
* Move some parts of TargetAsmInfo down to MCAsmInfo. This is not the greatestEvan Cheng2011-07-151-4/+4
| | | | | | | solution but it is a small step towards removing the horror that is TargetAsmInfo. llvm-svn: 135237
* Unfortunately several files in MC are badly violating layering rule by usingEvan Cheng2011-07-141-4/+5
| | | | | | | | | TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are other cases of violations, but this is probably the worst. This patch is but one small step towards fixing this. 500 more steps to go. :-( llvm-svn: 135131
* Fix comment.Evan Cheng2011-07-081-1/+1
| | | | llvm-svn: 134763
* This patch adds a flag in MCAsmInfo that indicates whether dwarf registerAkira Hatanaka2011-07-071-1/+1
| | | | | | | | | | numbers should be printed instead of symbolic register names in MCAsmStreamer::EmitRegisterName. This is necessary because some versions of GNU assembler won't accept code in which symbolic register names are used in cfi directives. There is no change in behavior unless the flag is explicitly set to true by a backend. llvm-svn: 134635
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-231-4/+4
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-231-4/+4
| | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. llvm-svn: 133700
* Remove the subclassing. This will be moved to the ASM printer.Bill Wendling2011-06-201-379/+0
| | | | llvm-svn: 133473
* * Override the "EmitBytes" function, since it can sneak values in that way.Bill Wendling2011-06-181-1/+18
| | | | | | * Make this used only if CFI is used. llvm-svn: 133319
* Remove false assertion.Bill Wendling2011-06-171-3/+1
| | | | llvm-svn: 133314
* Disable for another investigation.Bill Wendling2011-06-171-1/+2
| | | | llvm-svn: 133299
* Support only DwarfCFI or SjLj exception handling in LSDA decoder.Bill Wendling2011-06-171-1/+5
| | | | llvm-svn: 133297
* SjLj exception handling LSDA decoding support wasn't represented correctly. UseBill Wendling2011-06-171-17/+15
| | | | | | | the correct values, etc. In particular, the exception handling type is SjLj, not ARM. llvm-svn: 133296
* Disable to investigate ARM failure.Bill Wendling2011-06-171-1/+2
| | | | llvm-svn: 133293
* Use the verbose asm flag instead of a new flag for decoding the LSDA.Bill Wendling2011-06-171-2/+2
| | | | llvm-svn: 133292
* 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
OpenPOWER on IntegriCloud