From a0151d0e9f948b39e55944b5cad64fb33732af25 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 24 Aug 2009 11:56:58 +0000 Subject: 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 --- include/llvm/MC/MCAssembler.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') 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 // 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 SectionDataListType; @@ -371,6 +378,8 @@ public: typedef SymbolDataListType::const_iterator const_symbol_iterator; typedef SymbolDataListType::iterator symbol_iterator; + typedef std::vector::iterator indirect_symbol_iterator; + private: MCAssembler(const MCAssembler&); // DO NOT IMPLEMENT void operator=(const MCAssembler&); // DO NOT IMPLEMENT @@ -381,6 +390,8 @@ private: iplist Symbols; + std::vector 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 &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 -- cgit v1.1