diff options
author | Eric Christopher <echristo@gmail.com> | 2012-11-12 21:40:38 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2012-11-12 21:40:38 +0000 |
commit | d1726a4580f3dc42e2debbfea41acb9e815c06be (patch) | |
tree | 7b93c655e87f7362272c5dbbf0367ffd2a1b59b8 /lib/DebugInfo/DWARFContext.h | |
parent | f4e3309e849dd0b89a39363c7f2fac337c6db81e (diff) | |
download | llvm-d1726a4580f3dc42e2debbfea41acb9e815c06be.tar.gz llvm-d1726a4580f3dc42e2debbfea41acb9e815c06be.tar.bz2 llvm-d1726a4580f3dc42e2debbfea41acb9e815c06be.tar.xz |
Rewrite DIContext interface to take an object. Update all callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.h')
-rw-r--r-- | lib/DebugInfo/DWARFContext.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h index d3e9470a84..ff161e2aad 100644 --- a/lib/DebugInfo/DWARFContext.h +++ b/lib/DebugInfo/DWARFContext.h @@ -25,9 +25,6 @@ namespace llvm { /// information parsing. The actual data is supplied through pure virtual /// methods that a concrete implementation provides. class DWARFContext : public DIContext { - bool IsLittleEndian; - const RelocAddrMap *RelocMap; - SmallVector<DWARFCompileUnit, 1> CUs; OwningPtr<DWARFDebugAbbrev> Abbrev; OwningPtr<DWARFDebugAranges> Aranges; @@ -38,10 +35,9 @@ class DWARFContext : public DIContext { /// Read compile units from the debug_info section and store them in CUs. void parseCompileUnits(); -protected: - DWARFContext(bool isLittleEndian, const RelocAddrMap *Map) : - IsLittleEndian(isLittleEndian), RelocMap(Map) {} + public: + DWARFContext() {} virtual void dump(raw_ostream &OS); /// Get the number of compile units in this context. @@ -72,9 +68,8 @@ public: virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier = DILineInfoSpecifier()); - bool isLittleEndian() const { return IsLittleEndian; } - const RelocAddrMap *relocMap() const { return RelocMap; } - + virtual bool isLittleEndian() const = 0; + virtual const RelocAddrMap &relocMap() const = 0; virtual StringRef getInfoSection() = 0; virtual StringRef getAbbrevSection() = 0; virtual StringRef getARangeSection() = 0; @@ -99,6 +94,8 @@ private: /// pointers to it. class DWARFContextInMemory : public DWARFContext { virtual void anchor(); + bool IsLittleEndian; + RelocAddrMap RelocMap; StringRef InfoSection; StringRef AbbrevSection; StringRef ARangeSection; @@ -106,23 +103,9 @@ class DWARFContextInMemory : public DWARFContext { StringRef StringSection; StringRef RangeSection; public: - DWARFContextInMemory(bool isLittleEndian, - StringRef infoSection, - StringRef abbrevSection, - StringRef aRangeSection, - StringRef lineSection, - StringRef stringSection, - StringRef rangeSection, - const RelocAddrMap *Map = 0) - : DWARFContext(isLittleEndian, Map), - InfoSection(infoSection), - AbbrevSection(abbrevSection), - ARangeSection(aRangeSection), - LineSection(lineSection), - StringSection(stringSection), - RangeSection(rangeSection) - {} - + DWARFContextInMemory(object::ObjectFile *); + virtual bool isLittleEndian() const { return IsLittleEndian; } + virtual const RelocAddrMap &relocMap() const { return RelocMap; } virtual StringRef getInfoSection() { return InfoSection; } virtual StringRef getAbbrevSection() { return AbbrevSection; } virtual StringRef getARangeSection() { return ARangeSection; } |