summaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAssembler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* MC: Give a (lame) hard error if a .org directive would create an unreasonablyDaniel Dunbar2010-09-091-1/+1
| | | | | | large object file (> 1GB). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113494 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111376 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111171 91177308-0d34-0410-b5e6-96231b3b80d8
* Record a symbol's size which is needed for ELF symbol tables.Matt Fleming2010-08-161-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111170 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Initialize MCFragment::Offset, noticed by Cameron Esfahani.Daniel Dunbar2010-07-301-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109875 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).Daniel Dunbar2010-07-281-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109649 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial modifications to MCAssembler and TargetMachine for the MCJIT.Reid Kleckner2010-07-221-4/+10
| | | | | | | Patch by Olivier Meurant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109080 91177308-0d34-0410-b5e6-96231b3b80d8
* The variable ValueSize is set to 1 on both code paths, and thenDuncan Sands2010-06-291-5/+1
| | | | | | | ignored! Remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107138 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.Daniel Dunbar2010-06-161-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106142 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105274 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: When running with -mc-relax-all, we can eagerly relax instructions and ↵Daniel Dunbar2010-05-261-5/+2
| | | | | | avoid creating unnecessary MCInstFragments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104736 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Change RelaxInstruction to only take the input and output instructions.Daniel Dunbar2010-05-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104713 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify MayNeedRelaxation to not provide the fixups, so we can query itDaniel Dunbar2010-05-261-1/+1
| | | | | | before encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104707 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCAsmFixup, replace with MCFixup.Daniel Dunbar2010-05-261-12/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104699 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Use accessors for access to MCAsmFixup.Daniel Dunbar2010-05-261-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104697 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCFragment vtable, which was unnecessary.Daniel Dunbar2010-05-261-69/+62
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104689 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch to completely lazy layout.Daniel Dunbar2010-05-141-19/+35
| | | | | | - The eliminates the last major algorithmic problem with MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103754 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103753 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Implicitly assign section addresses when the previous fragment is layed out.Daniel Dunbar2010-05-141-1/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103752 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch MCFragment to storing the layout order index, not its index in ↵Daniel Dunbar2010-05-141-13/+14
| | | | | | the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103751 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Change LayoutSection() to only do the section initializiation.Daniel Dunbar2010-05-141-25/+13
| | | | | | Also, elimminate MCAsmLayout::set*, which are no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103750 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move Layout{Fragment,Section} into MCAsmLayout, and add LayoutFile().Daniel Dunbar2010-05-131-26/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103738 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Factor out MCAssembler::ComputeFragmentSize.Daniel Dunbar2010-05-131-36/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103724 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add section layout order indices to MCSectionData.Daniel Dunbar2010-05-131-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103715 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move ordinal calculation, to make sure fragments synthesized for layout ↵Daniel Dunbar2010-05-131-21/+21
| | | | | | get assigned ordinals properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103711 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Create dummy fragments to avoid ever having empty sections, which ↵Daniel Dunbar2010-05-131-8/+9
| | | | | | simplifies layout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103710 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCAsmLayout::FragmentReplaced() helper function.Daniel Dunbar2010-05-131-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103709 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Asserts warning.Daniel Dunbar2010-05-131-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103697 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCSectionData::{,Address,File}Size, which can now be computed byDaniel Dunbar2010-05-131-42/+28
| | | | | | utility functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103695 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103693 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103690 91177308-0d34-0410-b5e6-96231b3b80d8
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103689 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move MCAlignFragment::EmitNops value out of the constructor.Daniel Dunbar2010-05-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103665 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCZeroFillFragment, it is no longer needed.Daniel Dunbar2010-05-121-23/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103664 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Explicitly check that only virtual fragments appear in virtual sections.Daniel Dunbar2010-05-121-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103663 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103662 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Drop support for alignment in ZeroFill fragment, we can just useDaniel Dunbar2010-05-121-11/+4
| | | | | | MCAlignFragments for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103661 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-05-121-5/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103651 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Factor out MCAssembler::LayoutFragmentDaniel Dunbar2010-05-121-74/+78
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103649 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Tweak section layout to not relying on accumulating address value.Daniel Dunbar2010-05-121-7/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103648 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify LayoutSection to just take the index of the section to layout.Daniel Dunbar2010-05-121-18/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103627 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Track section layout order explicitly, and use to simplify.Daniel Dunbar2010-05-121-31/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103616 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Add a new hook for checking whether a particular section canDaniel Dunbar2010-05-121-0/+6
| | | | | | | | be diced into atoms, and adjust getAtom() to take this into account. - This fixes relocations to symbols in fixed size literal sections, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103532 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O x86_64: Switch to using fragment atom symbol.Daniel Dunbar2010-05-111-37/+6
| | | | | | | | | - This eliminates getAtomForAddress() (which was a linear search) and simplifies getAtom(). - This also fixes some correctness problems where local labels at the same address as non-local labels could be assigned to the wrong atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103480 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Explicitly track atoms, as represented by their defining symbol, ↵Daniel Dunbar2010-05-101-5/+1
| | | | | | for each fragment (not yet used). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103438 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fix case were we would skip a line in the .s file after an instructionDaniel Dunbar2010-05-041-1/+3
| | | | | | | | match failure. Also, fixes a few memory leak FIXMEs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102986 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always needDaniel Dunbar2010-03-251-6/+18
| | | | | | | exactly two passes in that case, and don't ever need to recompute any layout, so this is a nice baseline for relaxation performance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99563 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Stop restarting layout on every relaxation.Daniel Dunbar2010-03-251-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Still O(N^2), just a faster form, and now its the MCAsmLayout's fault. On the .s I am tuning against (combine.s from 403.gcc): -- ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt 5,10c5,10 < 1728 assembler - Number of assembler layout and relaxation steps < 7707 assembler - Number of emitted assembler fragments < 120588 assembler - Number of emitted object file bytes < 2233448 assembler - Number of evaluated fixups < 1727 assembler - Number of relaxed instructions < 6723845 mcexpr - Number of MCExpr evaluations --- > 3 assembler - Number of assembler layout and relaxation steps > 7707 assembler - Number of emitted assembler fragments > 120588 assembler - Number of emitted object file bytes > 14796 assembler - Number of evaluated fixups > 1727 assembler - Number of relaxed instructions > 67889 mcexpr - Number of MCExpr evaluations -- Feel free to LOL at the -before numbers, if you like. I am a little surprised we make more than 2 relaxation passes. It's pretty trivial for us to do relaxation out-of-order if that would give a speedup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99543 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify main section layout process by moving alignment into LayoutSection.Daniel Dunbar2010-03-251-30/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99529 91177308-0d34-0410-b5e6-96231b3b80d8