aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAssembler.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* MC: Route access to SectionData offset and file size through MCAsmLayout.Daniel Dunbar2010-03-251-10/+31
| | | | 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-30/+54
| | | | 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-9/+7
| | | | 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-21/+49
| | | | | | MCAsmLayout object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sprinkle in some more interesting statistics.Daniel Dunbar2010-03-231-1/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99350 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch to using MCInst fragments to do relaxation.Daniel Dunbar2010-03-231-78/+50
| | | | | | Also, both MCMachOStreamer and MCAssembler are now target independent! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99256 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a ↵Daniel Dunbar2010-03-231-1/+1
| | | | | | particular instruction + fixups might need relaxation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99249 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target ↵Daniel Dunbar2010-03-231-62/+9
| | | | | | dependencies in MCMachOStreamer and MCAssembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99248 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Tweak MCInstFragment to include the encoded data and fixups, so that we ↵Daniel Dunbar2010-03-231-13/+5
| | | | | | 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-4/+80
| | | | 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-3/+4
| | | | | | would do, and sprinkle in some const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99218 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-03-221-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99217 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead ↵Daniel Dunbar2010-03-221-1/+1
| | | | | | of a MCDataFragment). Object files should only need the generic MCFragment features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99205 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Eliminate MCFragment::getMaxFileSize.Daniel Dunbar2010-03-221-2/+7
| | | | 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-15/+10
| | | | | | important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99202 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::createObjectWriter.Daniel Dunbar2010-03-191-7/+7
| | | | | | - MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98955 91177308-0d34-0410-b5e6-96231b3b80d8
* MCCodeEmitter: Add target independent fixup flag for is-pc-relative.Daniel Dunbar2010-03-191-12/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98954 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Sink code emitter into MCAssembler.Daniel Dunbar2010-03-191-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98953 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Move to MachObjectWriter.{h,cpp}.Daniel Dunbar2010-03-191-820/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98952 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add TargetAsmBackend::isVirtualSection hook.Daniel Dunbar2010-03-191-15/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98950 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Split MCObjectWriter out of MCAssembler.cpp.Daniel Dunbar2010-03-191-131/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98949 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAssembler: Pull out MCObjectWriter class.Daniel Dunbar2010-03-191-82/+126
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98948 91177308-0d34-0410-b5e6-96231b3b80d8
* MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target ↵Daniel Dunbar2010-03-191-12/+1
| | | | | | specific not object writer specific task. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98947 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Lift the fixup evaluation and application up (to the same place), ↵Daniel Dunbar2010-03-191-35/+31
| | | | | | 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-31/+33
| | | | | | 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: Lift relocation emission logic a bit higher to separate ↵Daniel Dunbar2010-03-191-56/+77
| | | | | | evaluation / relocation handling from the actual .o writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98942 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Add isScatteredFixupFullyResolved, which implements the correct ↵Daniel Dunbar2010-03-191-1/+59
| | | | | | | | algorithm (used on x86_64) for determining whether an evaluated fixup is fully resolved (doesn't need relocation). - Test cases will follow, once we have x86_64 relocation support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98926 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Add getAtom[ForAddress].Daniel Dunbar2010-03-191-0/+36
| | | | | | - 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 isScatteredFixupFullyResolvedSimple predicate, and fix ↵Daniel Dunbar2010-03-191-15/+52
| | | | | | some corner cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98924 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a ↵Daniel Dunbar2010-03-191-10/+18
| | | | | | 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
* MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will ↵Daniel Dunbar2010-03-181-14/+14
| | | | | | need this for accessing to symbol modifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98791 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O/x86_64: Temporary labels in cstring sections require symbols (and ↵Daniel Dunbar2010-03-151-2/+8
| | | | | | external relocations, but we don't have x86_64 relocations yet). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98583 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Add MCSectionMachO::getType()Daniel Dunbar2010-03-151-12/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98582 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/X86_64: Symbol support.Daniel Dunbar2010-03-131-6/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98456 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Initial x86_64 support.Daniel Dunbar2010-03-131-45/+80
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98454 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: PCrel relocations weren't using the right base address, they areDaniel Dunbar2010-03-131-1/+1
| | | | | | | relative to the fragment address, not its offset. This was masked by the text section normally being at address 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98420 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Implement initial support for relaxation.Daniel Dunbar2010-03-121-9/+117
| | | | | | | | | | | | - 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-33/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Add MCSymbolData::getAddress() utility.Daniel Dunbar2010-03-111-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98266 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Implement "absolutizing" semantics of .set, by evaluating the ↵Daniel Dunbar2010-03-111-2/+8
| | | | | | assembly time value of variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98241 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Start passing in the basic MCAsmLayout object.Daniel Dunbar2010-03-111-13/+14
| | | | | | - Also, drop the current location part of AsmLayout, I think I prefer to implement this via explicit symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98240 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Provide MCAssembler with a TargetAsmBackend.Daniel Dunbar2010-03-111-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98222 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Use the MCAssembler symbol map instead of reconstructing.Daniel Dunbar2010-03-101-32/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98187 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Resolve a FIXME; these relocation types are no longer semanticaly ↵Daniel Dunbar2010-03-101-3/+5
| | | | | | different. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98120 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Use the SECTDIFF relocation type for (A - B + constant) where A ↵Daniel Dunbar2010-03-101-8/+11
| | | | | | | | is external. - I'm not sure why, but this is what 'as' does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98115 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: For PCrel relocations, we need to compensate for the PCrel ↵Daniel Dunbar2010-03-091-5/+9
| | | | | | adjustment when determining if we need a scattered relocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98082 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Also set the PCrel bit in the second half of paired relocation ↵Daniel Dunbar2010-03-091-4/+2
| | | | | | entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98081 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Don't generate relocations for PCrel fixups to local labels.Daniel Dunbar2010-03-091-9/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98080 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Tweak .dump() formatting.Daniel Dunbar2010-03-091-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98028 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Don't adjust section sizes when aligning zero fill sections, just ↵Daniel Dunbar2010-03-091-5/+1
| | | | | | pad the address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98027 91177308-0d34-0410-b5e6-96231b3b80d8