aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectStreamer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-07-25Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng1-3/+3
createMCAsmBackend. llvm-svn: 136010
2011-07-23Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng1-1/+1
they belong. llvm-svn: 135833
2011-07-14Unfortunately several files in MC are badly violating layering rule by usingEvan Cheng1-3/+2
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
2011-05-19Misc code refactorings:Rafael Espindola1-4/+4
* Remove unnecessary arguments now that ForceExpAbs is a method. * Use ForceExpAbs in EmitAbsValue. llvm-svn: 131683
2011-05-01Simplify the handling of pcrel relocations on ELF. Now we do the right thingRafael Espindola1-2/+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
2011-04-30Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.Rafael Espindola1-22/+0
llvm-svn: 130585
2011-04-27Factor a bit of code to MCStreamer::EmitLabel. Keep track of the lastRafael Espindola1-4/+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
2011-04-26No relocation produces a SLEB or ULEB, make sure they are handled in MC.Rafael Espindola1-10/+12
llvm-svn: 130181
2011-04-21Remove unused argument.Rafael Espindola1-6/+4
llvm-svn: 129955
2011-04-18malloc elimination: it's a bad idea to use raw_svector_ostream on aEli Friedman1-1/+4
small heap-allocated SmallString because it unconditionally forces a malloc. (Revised version of r129688, with the necessary flush() call.) llvm-svn: 129716
2011-04-18Revert r129688; it's breaking buildbots.Eli Friedman1-3/+1
llvm-svn: 129689
2011-04-18More malloc elimination: it's a bad idea to use raw_svector_ostream on aEli Friedman1-1/+3
small heap-allocated SmallString because it unconditionally forces a malloc. llvm-svn: 129688
2011-03-09Add constructors to MCElfStreamer and MCObjectStreamer to take an extra ↵Jan Sjödin1-0/+7
MCAssembler * argument. llvm-svn: 127343
2011-02-20Add some limited support for labels in org directives. Hopefully enough to fixRafael Espindola1-1/+17
PR9245. llvm-svn: 126091
2011-02-16Add support for pushsection and popsection. Patch by Joerg Sonnenberger.Rafael Espindola1-8/+3
llvm-svn: 125629
2011-01-13Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a stepEvan Cheng1-1/+4
in the right direction. It eliminated some hacks and will unblock codegen work. But it's far from being done. It doesn't reject illegal expressions, e.g. (FOO - :lower16:BAR). It also doesn't work in Thumb2 mode at all. llvm-svn: 123369
2010-12-28Relax address updates in the eh_frame section.Rafael Espindola1-13/+36
llvm-svn: 122591
2010-12-22Assert that the AddrDelta expression is really constant and wrap it in a setRafael Espindola1-1/+7
if we have a lame assembler. llvm-svn: 122446
2010-12-18Revert 122011, 122012, 122013, 122023 adding back an important optimization.Rafael Espindola1-4/+4
I added a note, but suggestions on how to add a test are really welcome. llvm-svn: 122138
2010-12-17MC/Assembler: Make the MCObjectWriter available through the lifetime of theDaniel Dunbar1-4/+6
assembler. llvm-svn: 122031
2010-12-17MC: Remove another dead MCAssembler argument, and update clients.Daniel Dunbar1-4/+4
llvm-svn: 122013
2010-12-10Fixed version of 121434 with no new memory leaks.Rafael Espindola1-4/+10
llvm-svn: 121471
2010-12-10Revert my previous patch to make the valgrind bots happy.Rafael Espindola1-10/+4
llvm-svn: 121461
2010-12-09Initial support for the cfi directives. This is just enough to getRafael Espindola1-4/+10
f: .cfi_startproc nop .cfi_endproc assembled (on ELF). llvm-svn: 121434
2010-12-07Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola1-3/+1
actuall addresses in a .o file, so it is better to let the MachO writer compute it. This is good for two reasons. First, areas that shouldn't care about addresses now don't have access to it. Second, the layout of each section is independent. I should use this in a subsequent commit to speed it up. Most of the patch is just removing the section address computation. The two interesting parts are the change on how we handle padding in the end of sections and how MachO can get the address of a-b when a and b are in different sections. Since now the expression evaluation normally doesn't know the section address, it will think that a-b needs relocation and let the MachO writer know. Once it has computed the section addresses, it calls back the expression evaluation with the section addresses to resolve these expressions. The remaining problem is the handling of padding. Currently it will create a special alignment fragment at the end. Since that fragment doesn't update the alignment of the section, it needs the real address to be computed. Since now the layout will not compute a-b with a and b in different sections, the only effect that the special alignment fragment has is update the address size of the section. This can also be done by the MachO writer. llvm-svn: 121076
2010-12-06Use references to simplify the code a bit.Rafael Espindola1-4/+4
llvm-svn: 121050
2010-12-04There are two reasons why we might want to useRafael Espindola1-1/+1
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
2010-12-03Make EmitIntValue more efficient and more like what we do for leb128. TheRafael Espindola1-9/+7
difference is much smaller (about 0.3s) but significant. llvm-svn: 120787
2010-12-03Do with uleb the same trick we now do with dwarf line/address advances. ThisRafael Espindola1-0/+10
avoids creating leb128 fragments and speeds up the test in PR8711 to 33s. llvm-svn: 120774
2010-12-03Try to resolve symbol differences early, and if successful create a plainRafael Espindola1-0/+24
data fragment. This reduces the time to assemble the test in 8711 from 60s to 54s. llvm-svn: 120767
2010-12-02Use set directive for StartMinusEndExpr.Devang Patel1-1/+1
This is a fix for llvm-gcc-i386-darwin9 buildbot failure. llvm-svn: 120742
2010-12-02Move EmitValueToOffset to the ObjectStreamer.Rafael Espindola1-0/+5
llvm-svn: 120691
2010-12-02Add EmitInstToFragment to the generic object streamer.Rafael Espindola1-0/+7
llvm-svn: 120690
2010-11-28Move EmitValue to MCObjectStreamer.Rafael Espindola1-0/+19
llvm-svn: 120269
2010-11-28Fixed verson of r120245.Rafael Espindola1-0/+19
Factor some duplicated code into MCObjectStreamer::EmitLabel. llvm-svn: 120248
2010-11-28Revert previous patch while I debug the darwin bootstrap failure.Rafael Espindola1-20/+0
llvm-svn: 120246
2010-11-28Factor some duplicated code into MCObjectStreamer::EmitLabel.Rafael Espindola1-0/+20
llvm-svn: 120245
2010-11-02Add support for expressions in .sleb/.uleb directives.Rafael Espindola1-0/+10
llvm-svn: 118023
2010-11-01Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.Rafael Espindola1-0/+34
llvm-svn: 117925
2010-11-01Implement .weakref.Rafael Espindola1-0/+5
llvm-svn: 117911
2010-09-22Avoid some Mach-O specific alignment being done on ELF.Rafael Espindola1-2/+5
llvm-svn: 114594
2010-09-02Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.Benjamin Kramer1-0/+1
llvm-svn: 112849
2010-07-29Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ↵Benjamin Kramer1-0/+4
ownership of the TargetAsmBackend and the MCCodeEmitter. llvm-svn: 109767
2010-07-19MC: Add WinCOFFStreamer implementation and merge common code from MachOMichael J. Spencer1-0/+43
into MCObjectStreamer. Origonal Windows COFF implementation by Nathan Jedffords. llvm-svn: 108678
2010-06-16MC: Lift SwitchSection() and Finish() into MCObjectStreamer.Daniel Dunbar1-2/+17
llvm-svn: 106141
2010-06-16MC: Factor out an MCObjectStreamer class, which will be shared by the concreteDaniel Dunbar1-0/+24
object file format writers. llvm-svn: 106140