diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-24 11:56:58 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-24 11:56:58 +0000 |
commit | a0151d0e9f948b39e55944b5cad64fb33732af25 (patch) | |
tree | 8af4df64a2907bb3c054bd4a595f5aa3e413a25d /include | |
parent | b69f053e0d5af3463d1bbf2101e5c1431cca6fee (diff) | |
download | external_llvm-a0151d0e9f948b39e55944b5cad64fb33732af25.zip external_llvm-a0151d0e9f948b39e55944b5cad64fb33732af25.tar.gz external_llvm-a0151d0e9f948b39e55944b5cad64fb33732af25.tar.bz2 |
llvm-mc/Mach-O: Preliminary support for indirect symbols.
- The indirect table itself isn't being filled in yet.
- This isn't factored properly and is rather FIXMEd, but at the moment I'm more
focused on figuring out what it needs to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCAssembler.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index aae5f08..b5ee501 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -16,6 +16,7 @@ #include "llvm/MC/MCValue.h" #include "llvm/Support/Casting.h" #include "llvm/Support/DataTypes.h" +#include <vector> // FIXME: Shouldn't be needed. namespace llvm { class raw_ostream; @@ -360,6 +361,12 @@ public: /// @} }; +// FIXME: This really doesn't belong here. See comments below. +struct IndirectSymbolData { + MCSymbol *Symbol; + MCSectionData *SectionData; +}; + class MCAssembler { public: typedef iplist<MCSectionData> SectionDataListType; @@ -371,6 +378,8 @@ public: typedef SymbolDataListType::const_iterator const_symbol_iterator; typedef SymbolDataListType::iterator symbol_iterator; + typedef std::vector<IndirectSymbolData>::iterator indirect_symbol_iterator; + private: MCAssembler(const MCAssembler&); // DO NOT IMPLEMENT void operator=(const MCAssembler&); // DO NOT IMPLEMENT @@ -381,6 +390,8 @@ private: iplist<MCSymbolData> Symbols; + std::vector<IndirectSymbolData> IndirectSymbols; + private: /// LayoutSection - Assign offsets and sizes to the fragments in the section /// \arg SD, and update the section size. The section file offset should @@ -432,6 +443,27 @@ public: size_t symbol_size() const { return Symbols.size(); } /// @} + /// @name Indirect Symbol List Access + /// @{ + + // FIXME: This is a total hack, this should not be here. Once things are + // factored so that the streamer has direct access to the .o writer, it can + // disappear. + std::vector<IndirectSymbolData> &getIndirectSymbols() { + return IndirectSymbols; + } + + indirect_symbol_iterator indirect_symbol_begin() { + return IndirectSymbols.begin(); + } + + indirect_symbol_iterator indirect_symbol_end() { + return IndirectSymbols.end(); + } + + size_t indirect_symbol_size() const { return IndirectSymbols.size(); } + + /// @} }; } // end namespace llvm |