summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* These functions have default arguments of 0 for the last arg. UseEric Christopher2013-01-091-1/+1
| | | | | | them and add one where it seemed obvious that we wanted one. llvm-svn: 171932
* Renamed MCInstFragment to MCRelaxableFragment and added some comments.Eli Bendersky2013-01-081-1/+2
| | | | | | No change in functionality. llvm-svn: 171822
* Add the align_to_end option to .bundle_lock in the MC implementation of alignedEli Bendersky2013-01-071-1/+1
| | | | | | | | | bundling. The document describing this feature and the implementation has also been updated: https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm llvm-svn: 171797
* small fixes to enable the reuse of the pass manager across multiple modulesPedro Artigas2013-01-041-0/+1
| | | | llvm-svn: 171475
* Aligned bundling support. Following the discussion here:Eli Bendersky2012-12-201-5/+28
| | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056754.html The proposal and implementation are fully documented here: https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm Tests will follow shortly. llvm-svn: 170718
* This patch is needed to make c++ exceptions work for mips16.Reed Kotler2012-12-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mips16 is really a processor decoding mode (ala thumb 1) and in the same program, mips16 and mips32 functions can exist and can call each other. If a jal type instruction encounters an address with the lower bit set, then the processor switches to mips16 mode (if it is not already in it). If the lower bit is not set, then it switches to mips32 mode. The linker knows which functions are mips16 and which are mips32. When relocation is performed on code labels, this lower order bit is set if the code label is a mips16 code label. In general this works just fine, however when creating exception handling tables and dwarf, there are cases where you don't want this lower order bit added in. This has been traditionally distinguished in gas assembly source by using a different syntax for the label. lab1: ; this will cause the lower order bit to be added lab2=. ; this will not cause the lower order bit to be added In some cases, it does not matter because in dwarf and debug tables the difference of two labels is used and in that case the lower order bits subtract each other out. To fix this, I have added to mcstreamer the notion of a debuglabel. The default is for label and debug label to be the same. So calling EmitLabel and EmitDebugLabel produce the same result. For various reasons, there is only one set of labels that needs to be modified for the mips exceptions to work. These are the "$eh_func_beginXXX" labels. Mips overrides the debug label suffix from ":" to "=." . This initial patch fixes exceptions. More changes most likely will be needed to DwarfCFException to make all of this work for actual debugging. These changes will be to emit debug labels in some places where a simple label is emitted now. Some historical discussion on this from gcc can be found at: http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html llvm-svn: 170279
* Add more reset methods to make all objects that the backend may use for ↵Pedro Artigas2012-12-141-1/+2
| | | | | | outputting code have a reset, some are not used but were declared for completeness llvm-svn: 170227
* Make the MCStreamer have a reset method and call that after finalization of ↵Pedro Artigas2012-12-121-0/+5
| | | | | | | | the asm printer, also changed MCContext to a single reset only method for simplicity as requested on the list llvm-svn: 170041
* Refactor MCInstFragment and MCDataFragment to adhere to a common interface,Eli Bendersky2012-12-071-6/+8
| | | | | | | | | which removes code duplication and prepares the ground for future additions. Full discussion: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/158233.html llvm-svn: 169626
* Lift EmitAssignment into MCObjectStreamer which gets rid of at least threeEli Bendersky2012-12-071-0/+5
| | | | | | duplicate implementations in format-specific streamers. llvm-svn: 169613
* Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into ↵Benjamin Kramer2012-10-041-0/+25
| | | | | | MCObjectStreamer. llvm-svn: 165225
* Provide a shortcut for MCObjectStreamer when emitting fills.Benjamin Kramer2012-10-011-0/+8
| | | | | | | Reduces runtime of i386-large-relocations.s by 10x in Release builds, even more in Debug+Asserts builds. llvm-svn: 164945
* For mips64 switch statements in subroutines could generate Jack Carter2012-08-221-3/+9
| | | | | | | | | | | | | within the codegen EK_GPRel64BlockAddress. This was not supported for direct object output and resulted in an assertion. This change adds support for EK_GPRel64BlockAddress for direct object. One fallout from this is to turn on rela relocations for mips64 to match gas. llvm-svn: 162334
* Prune some includes and forward declarations.Craig Topper2012-03-261-4/+4
| | | | llvm-svn: 153429
* Correctly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.Rafael Espindola2012-03-031-1/+1
| | | | llvm-svn: 151979
* On ELF, create relocations to the abbreviation and line sections when producingRafael Espindola2012-02-281-2/+3
| | | | | | | | | | debug info for assembly files. We were already doing the right thing when producing debug info for C/C++. ELF linkers don't know dwarf, so they depend on these relocations to produce valid dwarf output. llvm-svn: 151655
* Better diagnostic for malformed .org assembly directive.Jim Grosbach2012-01-271-3/+4
| | | | | | Provide source line number information. llvm-svn: 149101
* Tidy up.Jim Grosbach2012-01-261-1/+1
| | | | llvm-svn: 149096
* Tidy up. MCAsmBackend naming conventions.Jim Grosbach2012-01-181-4/+4
| | | | llvm-svn: 148400
* Don't print an unused label before .cfi_endproc.Rafael Espindola2012-01-091-0/+4
| | | | llvm-svn: 147763
* Don't print a label before .cfi_startproc when we don't need to. This makesRafael Espindola2012-01-071-0/+4
| | | | | | the produce assembly when using CFI just a bit more readable. llvm-svn: 147743
* Split Finish into Finish and FinishImpl to have a common place to do end ofRafael Espindola2012-01-071-1/+1
| | | | | | | | file error checking. Use that to error on an unfinished cfi_startproc. The error is not nice, but is already better than a segmentation fault. llvm-svn: 147717
* The second part of support for generating dwarf for assembly source files. ThisKevin Enderby2011-12-091-0/+4
| | | | | | | | | | generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. The next part will be to get the clang driver to enable this when assembling a .s file. rdar://9275556 llvm-svn: 146262
* This patch addresses gp relative fixups/relocations for jump tables.Akira Hatanaka2011-11-231-0/+10
| | | | llvm-svn: 145112
* Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to ↵Evan Cheng2011-07-251-3/+3
| | | | | | createMCAsmBackend. llvm-svn: 136010
* Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where ↵Evan Cheng2011-07-231-1/+1
| | | | | | they belong. llvm-svn: 135833
* Unfortunately several files in MC are badly violating layering rule by usingEvan Cheng2011-07-141-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
* Misc code refactorings:Rafael Espindola2011-05-191-4/+4
| | | | | | | * Remove unnecessary arguments now that ForceExpAbs is a method. * Use ForceExpAbs in EmitAbsValue. llvm-svn: 131683
* Simplify the handling of pcrel relocations on ELF. Now we do the right thingRafael Espindola2011-05-011-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
* Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.Rafael Espindola2011-04-301-22/+0
| | | | llvm-svn: 130585
* Factor a bit of code to MCStreamer::EmitLabel. Keep track of the lastRafael Espindola2011-04-271-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
* No relocation produces a SLEB or ULEB, make sure they are handled in MC.Rafael Espindola2011-04-261-10/+12
| | | | llvm-svn: 130181
* Remove unused argument.Rafael Espindola2011-04-211-6/+4
| | | | llvm-svn: 129955
* malloc elimination: it's a bad idea to use raw_svector_ostream on aEli Friedman2011-04-181-1/+4
| | | | | | | | small heap-allocated SmallString because it unconditionally forces a malloc. (Revised version of r129688, with the necessary flush() call.) llvm-svn: 129716
* Revert r129688; it's breaking buildbots.Eli Friedman2011-04-181-3/+1
| | | | llvm-svn: 129689
* More malloc elimination: it's a bad idea to use raw_svector_ostream on aEli Friedman2011-04-181-1/+3
| | | | | | small heap-allocated SmallString because it unconditionally forces a malloc. llvm-svn: 129688
* Add constructors to MCElfStreamer and MCObjectStreamer to take an extra ↵Jan Sjödin2011-03-091-0/+7
| | | | | | MCAssembler * argument. llvm-svn: 127343
* Add some limited support for labels in org directives. Hopefully enough to fixRafael Espindola2011-02-201-1/+17
| | | | | | PR9245. llvm-svn: 126091
* Add support for pushsection and popsection. Patch by Joerg Sonnenberger.Rafael Espindola2011-02-161-8/+3
| | | | llvm-svn: 125629
* Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a stepEvan Cheng2011-01-131-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
* Relax address updates in the eh_frame section.Rafael Espindola2010-12-281-13/+36
| | | | llvm-svn: 122591
* Assert that the AddrDelta expression is really constant and wrap it in a setRafael Espindola2010-12-221-1/+7
| | | | | | if we have a lame assembler. llvm-svn: 122446
* Revert 122011, 122012, 122013, 122023 adding back an important optimization.Rafael Espindola2010-12-181-4/+4
| | | | | | I added a note, but suggestions on how to add a test are really welcome. llvm-svn: 122138
* MC/Assembler: Make the MCObjectWriter available through the lifetime of theDaniel Dunbar2010-12-171-4/+6
| | | | | | assembler. llvm-svn: 122031
* MC: Remove another dead MCAssembler argument, and update clients.Daniel Dunbar2010-12-171-4/+4
| | | | llvm-svn: 122013
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-4/+10
| | | | llvm-svn: 121471
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-10/+4
| | | | llvm-svn: 121461
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-4/+10
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). llvm-svn: 121434
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-071-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
* Use references to simplify the code a bit.Rafael Espindola2010-12-061-4/+4
| | | | llvm-svn: 121050
OpenPOWER on IntegriCloud