diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-13 09:28:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-13 09:28:43 +0000 |
commit | 0bcf074867d4d366f7988a219c7a53265fcb4f23 (patch) | |
tree | b6a6bb081c18faca14f7a8ed903687aa4da4d380 /include | |
parent | a4766d7af91b7e25151b3e97a0831b3615d2abc3 (diff) | |
download | external_llvm-0bcf074867d4d366f7988a219c7a53265fcb4f23.zip external_llvm-0bcf074867d4d366f7988a219c7a53265fcb4f23.tar.gz external_llvm-0bcf074867d4d366f7988a219c7a53265fcb4f23.tar.bz2 |
MCAssembler: Sink fixup list into MCDataFragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCAssembler.h | 62 |
1 files changed, 23 insertions, 39 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 6b609d8..268a3fc 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -55,10 +55,6 @@ class MCFragment : public ilist_node<MCFragment> { void operator=(const MCFragment&); // DO NOT IMPLEMENT public: - typedef std::vector<MCAsmFixup>::const_iterator const_fixup_iterator; - typedef std::vector<MCAsmFixup>::iterator fixup_iterator; - -public: enum FragmentType { FT_Data, FT_Align, @@ -85,11 +81,6 @@ private: /// FileSize - The file size of this section. This is ~0 until initialized. uint64_t FileSize; - /// Fixups - The list of fixups in this fragment. - // - // FIXME: This should be sunk into MCDataFragment. - std::vector<MCAsmFixup> Fixups; - /// @} protected: @@ -111,36 +102,6 @@ public: return 0; } - /// @name Fixup Access - /// @{ - - /// LookupFixup - Look up the fixup for the given \arg Fragment and \arg - /// Offset. - /// - /// If multiple fixups exist for the same fragment and offset it is undefined - /// which one is returned. - // - // FIXME: This isn't horribly slow in practice, but there are much nicer - // solutions to applying the fixups. This will be fixed by sinking fixups into - // data fragments exclusively. - const MCAsmFixup *LookupFixup(uint64_t Offset) const { - for (unsigned i = 0, e = Fixups.size(); i != e; ++i) - if (Fixups[i].Offset == Offset) - return &Fixups[i]; - return 0; - } - - std::vector<MCAsmFixup> &getFixups() { return Fixups; } - const std::vector<MCAsmFixup> &getFixups() const { return Fixups; } - - fixup_iterator fixup_begin() { return Fixups.begin(); } - const_fixup_iterator fixup_begin() const { return Fixups.begin(); } - - fixup_iterator fixup_end() {return Fixups.end();} - const_fixup_iterator fixup_end() const {return Fixups.end();} - - size_t fixup_size() const { return Fixups.size(); } - /// @name Assembler Backend Support /// @{ // @@ -173,6 +134,13 @@ public: class MCDataFragment : public MCFragment { SmallString<32> Contents; + /// Fixups - The list of fixups in this fragment. + std::vector<MCAsmFixup> Fixups; + +public: + typedef std::vector<MCAsmFixup>::const_iterator const_fixup_iterator; + typedef std::vector<MCAsmFixup>::iterator fixup_iterator; + public: MCDataFragment(MCSectionData *SD = 0) : MCFragment(FT_Data, SD) {} @@ -188,6 +156,22 @@ public: /// @} + /// @name Fixup Access + /// @{ + + std::vector<MCAsmFixup> &getFixups() { return Fixups; } + const std::vector<MCAsmFixup> &getFixups() const { return Fixups; } + + fixup_iterator fixup_begin() { return Fixups.begin(); } + const_fixup_iterator fixup_begin() const { return Fixups.begin(); } + + fixup_iterator fixup_end() {return Fixups.end();} + const_fixup_iterator fixup_end() const {return Fixups.end();} + + size_t fixup_size() const { return Fixups.size(); } + + /// @} + static bool classof(const MCFragment *F) { return F->getKind() == MCFragment::FT_Data; } |