aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCAssembler.h
Commit message (Collapse)AuthorAgeFilesLines
* MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).Daniel Dunbar2010-07-281-0/+1
| | | | 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-1/+3
| | | | | | | Patch by Olivier Meurant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109080 91177308-0d34-0410-b5e6-96231b3b80d8
* use a typedef instead of its expansion, patch by Michael SpencerChris Lattner2010-07-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108229 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.Daniel Dunbar2010-06-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106142 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCAsmFixup, replace with MCFixup.Daniel Dunbar2010-05-261-40/+13
| | | | 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-2/+8
| | | | 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-12/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104689 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch MCFragment to storing the layout order index, not its index in ↵Daniel Dunbar2010-05-141-5/+5
| | | | | | the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103751 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Move Layout{Fragment,Section} into MCAsmLayout, and add LayoutFile().Daniel Dunbar2010-05-131-10/+0
| | | | 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-0/+6
| | | | 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/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103715 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCSectionData::{,Address,File}Size, which can now be computed byDaniel Dunbar2010-05-131-11/+0
| | | | | | utility functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103695 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCAlignFragment::OnlyAlignAddress bit. This is a bit of magic that ↵Daniel Dunbar2010-05-131-1/+11
| | | | | | 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-1/+5
| | | | | | 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-7/+8
| | | | 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-27/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103664 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch MCFillFragment to storing total fill size instead of a count. ↵Daniel Dunbar2010-05-121-6/+10
| | | | | | 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-8/+2
| | | | | | MCAlignFragments for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103661 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Factor out MCAssembler::LayoutFragmentDaniel Dunbar2010-05-121-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103649 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Simplify LayoutSection to just take the index of the section to layout.Daniel Dunbar2010-05-121-8/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103627 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a trivial function to modify the flags field of MCSymbolData class. ↵Nathan Jeffords2010-05-121-0/+5
| | | | | | The function takes the value and a mask, and clears the mask bits before applying the value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103534 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O x86_64: Switch to using fragment atom symbol.Daniel Dunbar2010-05-111-10/+0
| | | | | | | | | - 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-0/+9
| | | | | | 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: Add a -mc-relax-all option, which relaxes every fixup. We always needDaniel Dunbar2010-03-251-0/+4
| | | | | | | 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-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99529 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink Section address assignment into LayoutSection.Daniel Dunbar2010-03-251-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Explicity track section and fragment ordinals.Daniel Dunbar2010-03-251-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99500 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Route access to SectionData offset and file size through MCAsmLayout.Daniel Dunbar2010-03-251-23/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99474 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Route access to Fragment offset and effective size through MCAsmLayout.Daniel Dunbar2010-03-251-22/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99473 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.Daniel Dunbar2010-03-251-13/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99467 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Direct all {fragment,section,symbol} address access through the ↵Daniel Dunbar2010-03-241-4/+6
| | | | | | MCAsmLayout object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a ↵Daniel Dunbar2010-03-231-0/+4
| | | | | | particular instruction + fixups might need relaxation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Tweak MCInstFragment to include the encoded data and fixups, so that we ↵Daniel Dunbar2010-03-231-8/+37
| | | | | | don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99244 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add MCInstFragment, not used yet.Daniel Dunbar2010-03-221-2/+41
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99229 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment ↵Daniel Dunbar2010-03-221-2/+2
| | | | | | would do, and sprinkle in some const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99218 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCFragment::getMaxFileSize.Daniel Dunbar2010-03-221-32/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99203 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Share the MCAsmLayout object, although its still not used for anything ↵Daniel Dunbar2010-03-221-3/+4
| | | | | | important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99202 91177308-0d34-0410-b5e6-96231b3b80d8
* Acccess control is lameDouglas Gregor2010-03-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98962 91177308-0d34-0410-b5e6-96231b3b80d8
* struct -> class, to silence a Clang warningDouglas Gregor2010-03-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98961 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink code emitter into MCAssembler.Daniel Dunbar2010-03-191-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Split MCObjectWriter out of MCAssembler.cpp.Daniel Dunbar2010-03-191-17/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98949 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Lift the fixup evaluation and application up (to the same place), ↵Daniel Dunbar2010-03-191-6/+1
| | | | | | and eliminate MCAsmFixup::FixedValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98944 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout ↵Daniel Dunbar2010-03-191-0/+8
| | | | | | changes the object writer may need to make to the assembler from the actual .o writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98943 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Add getAtom[ForAddress].Daniel Dunbar2010-03-191-0/+13
| | | | | | - These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98925 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a ↵Daniel Dunbar2010-03-191-0/+6
| | | | | | made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98923 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some parens and silence a warning.Benjamin Kramer2010-03-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98428 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Implement initial support for relaxation.Daniel Dunbar2010-03-121-0/+8
| | | | | | | | | | | | - The implementation is currently very brain dead and inefficient, but I have a clear plan on how to fix it. - The good news is, it works and correctly assembles 403.gcc (when built with Clang, at '-Os', '-Os -g', and '-O3'). Even better, at '-Os' and '-Os -g', the resulting binary is exactly equivalent to that when built with the system assembler. So it probably works! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98396 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Factor out MCAssembler::EvaluateFixup, and simplify.Daniel Dunbar2010-03-121-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Constify MCAsmLayout argument to MCExpr::EvaluteAs...Daniel Dunbar2010-03-121-5/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98380 91177308-0d34-0410-b5e6-96231b3b80d8