diff options
| author | Frederic Riss <friss@apple.com> | 2014-09-15 07:50:27 +0000 |
|---|---|---|
| committer | Frederic Riss <friss@apple.com> | 2014-09-15 07:50:27 +0000 |
| commit | 4e126a0011973a63f2e674c2a08ab5f987bd0544 (patch) | |
| tree | 8d7ac39496de977d549dddd6c8228990a0b89682 /llvm/lib/DebugInfo/DWARFContext.h | |
| parent | 7dad93bec2657b444d02d027c7e41efd6c540c74 (diff) | |
| download | bcm5719-llvm-4e126a0011973a63f2e674c2a08ab5f987bd0544.tar.gz bcm5719-llvm-4e126a0011973a63f2e674c2a08ab5f987bd0544.zip | |
Introduce the DWARFUnitSection abstraction.
A DWARFUnitSection is the collection of Units that have been extracted from
the same debug section.
By embeding a reference to their DWARFUnitSection in each unit, the DIEs
will be able to resolve inter-unit references by interrogating their Unit's
DWARFUnitSection.
This is a minimal patch where the DWARFUnitSection is-a SmallVector of Units,
thus exposing exactly the same interface as before. Followup-up patches might
change from inheritance to composition in order to expose only the wanted
DWARFUnitSection abstraction.
Differential Revision: http://reviews.llvm.org/D5310
llvm-svn: 217747
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFContext.h')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.h b/llvm/lib/DebugInfo/DWARFContext.h index b72c119d253..f00191acb93 100644 --- a/llvm/lib/DebugInfo/DWARFContext.h +++ b/llvm/lib/DebugInfo/DWARFContext.h @@ -28,19 +28,17 @@ namespace llvm { /// information parsing. The actual data is supplied through pure virtual /// methods that a concrete implementation provides. class DWARFContext : public DIContext { - typedef SmallVector<std::unique_ptr<DWARFCompileUnit>, 1> CUVector; - typedef SmallVector<std::unique_ptr<DWARFTypeUnit>, 1> TUVector; - CUVector CUs; - TUVector TUs; + DWARFUnitSection<DWARFCompileUnit> CUs; + DWARFUnitSection<DWARFTypeUnit> TUs; std::unique_ptr<DWARFDebugAbbrev> Abbrev; std::unique_ptr<DWARFDebugLoc> Loc; std::unique_ptr<DWARFDebugAranges> Aranges; std::unique_ptr<DWARFDebugLine> Line; std::unique_ptr<DWARFDebugFrame> DebugFrame; - CUVector DWOCUs; - TUVector DWOTUs; + DWARFUnitSection<DWARFCompileUnit> DWOCUs; + DWARFUnitSection<DWARFTypeUnit> DWOTUs; std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO; std::unique_ptr<DWARFDebugLocDWO> LocDWO; @@ -77,8 +75,8 @@ public: void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override; - typedef iterator_range<CUVector::iterator> cu_iterator_range; - typedef iterator_range<TUVector::iterator> tu_iterator_range; + typedef DWARFUnitSection<DWARFCompileUnit>::iterator_range cu_iterator_range; + typedef DWARFUnitSection<DWARFTypeUnit>::iterator_range tu_iterator_range; /// Get compile units in this context. cu_iterator_range compile_units() { |

