summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAssembler.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reuse data fragments while lowering. Patch by David Meyer.Rafael Espindola2010-11-231-26/+77
| | | | llvm-svn: 119999
* Add an assert.Rafael Espindola2010-11-191-1/+3
| | | | llvm-svn: 119788
* make isVirtualSection a virtual method on MCSection. Chris' suggestion.Rafael Espindola2010-11-171-5/+5
| | | | llvm-svn: 119547
* Change MCExpr::EvaluateAsRelocatableImpl of variables to return the originalRafael Espindola2010-11-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | variable if recursing fails to simplify it. Factor AliasedSymbol to be a method of MCSymbol. Update MCAssembler::EvaluateFixup to match the change in EvaluateAsRelocatableImpl. Remove the WeakRefExpr hack, as the object writer now sees the weakref with no extra effort needed. Nothing else is using MCTargetExpr, but keep it for now. Now that the ELF writer sees relocations with aliases, handle .weak foo2 foo2: .weak bar2 .set bar2,foo2 .quad bar2 the same way gas does and produce a relocation with bar2. llvm-svn: 119152
* Speed up AddSectionToTheEnd. It was walking all fragments in all sections.Rafael Espindola2010-11-071-19/+4
| | | | | | | | | | This is really slow with we have 1000s of sections each with a corresponding relocation section. Also, it is only used by the ELF writer to add basic data, so there is no need to force a new layout pass. Should fix PR8563. llvm-svn: 118377
* Relax dwarf line fragments. This fixes a crash in the included testcase.Rafael Espindola2010-11-071-13/+18
| | | | llvm-svn: 118365
* Do relaxations with FT_Org fragments. Fixes the FIXME:Rafael Espindola2010-11-021-18/+24
| | | | | | | | | // FIXME: We should compute this sooner, we don't want to recurse here, and // we would like to be more functional. In MCAssembler::ComputeFragmentSize. llvm-svn: 118080
* Add support for expressions in .sleb/.uleb directives.Rafael Espindola2010-11-021-37/+96
| | | | llvm-svn: 118023
* This is the last major patch to implement support for the .loc directiveKevin Enderby2010-09-301-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and output the dwarf line number tables. This contains the code to emit and encode the dwarf line tables from the previously gathered information in the MCLineSection objects. This contains all the details to encode the line and address deltas into the dwarf line table. To do this an MCDwarfLineAddrFragment has been added. Also this moves the interface code out of Mach-O streamer into MCDwarf so it should be useable by other object file formats. There is now one call to be made from an MCObjectStreamer EmitInstruction() method: MCLineEntry::Make(this, getCurrentSection()); to create a line entry after each instruction is assembled. And one call call to be made from an MCObjectStreamer Finish() method: MCDwarfFileTable::Emit(this, DwarfLineSection); when getContext().hasDwarfFiles() is true and is passed a object file specific MCSection where to emit the dwarf file and the line tables. This appears to now be correct for 32-bit targets, at least x86. But the relocation entries for 64-bit Darwin needs some further work which is next up to work on. So for now the 64-bit Mach-O target does not output the dwarf file and line tables. llvm-svn: 115157
* Make it possible for the MCObjectWriter to decide if a given fixup is fullyRafael Espindola2010-09-301-128/+27
| | | | | | | | | | | resolved or not. Different object files have different restrictions and different native assemblers have different idiosyncrasies we want to emulate for now. Move the existing MachO logic to the new place and implement an ELF one that gets fixups to globals right. llvm-svn: 115131
* Remove unused argument.Rafael Espindola2010-09-271-4/+3
| | | | llvm-svn: 114852
* MC: Add missing ')' in diagnostic.Daniel Dunbar2010-09-241-1/+1
| | | | llvm-svn: 114717
* Avoid some Mach-O specific alignment being done on ELF.Rafael Espindola2010-09-221-18/+20
| | | | llvm-svn: 114594
* Add a InitSections method to the streamer interface.Rafael Espindola2010-09-151-1/+1
| | | | | | | | | | | | | | The ELF implementation now creates text, data and bss to match the gnu as behavior. The text streamer still has the old MachO specific behavior since the testsuite checks that it will error when a directive is given before a setting the current section for example. A nice benefit is that -n is not required anymore when producing ELF files. llvm-svn: 114027
* MC: Give a (lame) hard error if a .org directive would create an unreasonablyDaniel Dunbar2010-09-091-1/+1
| | | | | | large object file (> 1GB). llvm-svn: 113494
* MC/ELF: Allow null values in virtual sections, ELF doesn't use specialDaniel Dunbar2010-08-181-1/+16
| | | | | | directives for putting contents in .bss, for example. llvm-svn: 111376
* Layout helper function.Matt Fleming2010-08-161-0/+34
| | | | | | | | Introduce a helper method to add a section to the end of a layout. This will be used by the ELF ObjectWriter code to add the metadata sections (symbol table, etc) to the end of an object file. llvm-svn: 111171
* Record a symbol's size which is needed for ELF symbol tables.Matt Fleming2010-08-161-1/+2
| | | | llvm-svn: 111170
* MC: Initialize MCFragment::Offset, noticed by Cameron Esfahani.Daniel Dunbar2010-07-301-1/+2
| | | | llvm-svn: 109875
* MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).Daniel Dunbar2010-07-281-0/+3
| | | | llvm-svn: 109649
* Initial modifications to MCAssembler and TargetMachine for the MCJIT.Reid Kleckner2010-07-221-4/+10
| | | | | | Patch by Olivier Meurant! llvm-svn: 109080
* The variable ValueSize is set to 1 on both code paths, and thenDuncan Sands2010-06-291-5/+1
| | | | | | ignored! Remove it. llvm-svn: 107138
* MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.Daniel Dunbar2010-06-161-6/+5
| | | | llvm-svn: 106142
* Don't call flush() at a library level which isn't checking for errorsDan Gohman2010-06-011-1/+0
| | | | | | and doesn't know where the output is going. llvm-svn: 105274
* MC: When running with -mc-relax-all, we can eagerly relax instructions and ↵Daniel Dunbar2010-05-261-5/+2
| | | | | | avoid creating unnecessary MCInstFragments. llvm-svn: 104736
* MC: Change RelaxInstruction to only take the input and output instructions.Daniel Dunbar2010-05-261-1/+1
| | | | llvm-svn: 104713
* MC: Simplify MayNeedRelaxation to not provide the fixups, so we can query itDaniel Dunbar2010-05-261-1/+1
| | | | | | before encoding. llvm-svn: 104707
* MC: Eliminate MCAsmFixup, replace with MCFixup.Daniel Dunbar2010-05-261-12/+10
| | | | llvm-svn: 104699
* MC: Use accessors for access to MCAsmFixup.Daniel Dunbar2010-05-261-6/+7
| | | | llvm-svn: 104697
* MC: Eliminate MCFragment vtable, which was unnecessary.Daniel Dunbar2010-05-261-69/+62
| | | | llvm-svn: 104689
* MC: Switch to completely lazy layout.Daniel Dunbar2010-05-141-19/+35
| | | | | | - The eliminates the last major algorithmic problem with MC. llvm-svn: 103754
* MC: Extend MCAsmLayout to explicitly track which fragments have been layed ↵Daniel Dunbar2010-05-141-10/+44
| | | | | | out, and enforce several invariants to LayoutFragment to ensure we only do layout in a sensible order. llvm-svn: 103753
* MC: Implicitly assign section addresses when the previous fragment is layed out.Daniel Dunbar2010-05-141-1/+11
| | | | llvm-svn: 103752
* MC: Switch MCFragment to storing the layout order index, not its index in ↵Daniel Dunbar2010-05-141-13/+14
| | | | | | the file. llvm-svn: 103751
* MC: Change LayoutSection() to only do the section initializiation.Daniel Dunbar2010-05-141-25/+13
| | | | | | Also, elimminate MCAsmLayout::set*, which are no longer needed. llvm-svn: 103750
* MC: Move Layout{Fragment,Section} into MCAsmLayout, and add LayoutFile().Daniel Dunbar2010-05-131-26/+27
| | | | llvm-svn: 103738
* MC: Factor out MCAssembler::ComputeFragmentSize.Daniel Dunbar2010-05-131-36/+44
| | | | llvm-svn: 103724
* MC: Add section layout order indices to MCSectionData.Daniel Dunbar2010-05-131-0/+4
| | | | llvm-svn: 103715
* MC: Move ordinal calculation, to make sure fragments synthesized for layout ↵Daniel Dunbar2010-05-131-21/+21
| | | | | | get assigned ordinals properly. llvm-svn: 103711
* MC: Create dummy fragments to avoid ever having empty sections, which ↵Daniel Dunbar2010-05-131-8/+9
| | | | | | simplifies layout. llvm-svn: 103710
* MC: Add MCAsmLayout::FragmentReplaced() helper function.Daniel Dunbar2010-05-131-4/+6
| | | | llvm-svn: 103709
* Fix -Asserts warning.Daniel Dunbar2010-05-131-4/+2
| | | | llvm-svn: 103697
* MC: Eliminate MCSectionData::{,Address,File}Size, which can now be computed byDaniel Dunbar2010-05-131-42/+28
| | | | | | utility functions. llvm-svn: 103695
* MC: Switch to using explicit MCAlignFragments with OnlyAlignAddress bit insteadDaniel Dunbar2010-05-131-22/+31
| | | | | | | | of manually doing padding/editing layout in LayoutSection(). - This probably seems like six-of-one and half-dozen of another, but there is a method to my madness. llvm-svn: 103693
* MC: Add MCAlignFragment::OnlyAlignAddress bit. This is a bit of magic that ↵Daniel Dunbar2010-05-131-1/+17
| | | | | | says the align fragment shouldn't contribute to the logical section size, it is will be used for cleaning up the code to handle section alignment. llvm-svn: 103690
* MC: Add MCSectionData::AddressSize, which is the size of the address space ↵Daniel Dunbar2010-05-131-6/+15
| | | | | | consumed by the section. This can differ from both the section logical size, and the section size on disk (although the current code handles this without making an explicit distinction). llvm-svn: 103689
* MC: Move MCAlignFragment::EmitNops value out of the constructor.Daniel Dunbar2010-05-121-1/+1
| | | | llvm-svn: 103665
* MC: Eliminate MCZeroFillFragment, it is no longer needed.Daniel Dunbar2010-05-121-23/+1
| | | | llvm-svn: 103664
* MC: Explicitly check that only virtual fragments appear in virtual sections.Daniel Dunbar2010-05-121-0/+23
| | | | llvm-svn: 103663
* MC: Switch MCFillFragment to storing total fill size instead of a count. ↵Daniel Dunbar2010-05-121-3/+3
| | | | | | This allows using ValueSize==0 to represent a virtual fill. llvm-svn: 103662
OpenPOWER on IntegriCloud