[X86][Haswell][SchedModel] Add architecture specific scheduling models.
[oota-llvm.git] / lib / DebugInfo / DWARFContext.h
index 42d34b18f46f998d58e00efcd0ea83211097d984..f4c05c7d57361ec9f39d509037c05a6a7bfe96c1 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===/
 
-#ifndef LLVM_DEBUGINFO_DWARFCONTEXT_H
-#define LLVM_DEBUGINFO_DWARFCONTEXT_H
+#ifndef LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
+#define LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H
 
 #include "DWARFCompileUnit.h"
 #include "DWARFDebugAranges.h"
@@ -28,8 +28,8 @@ namespace llvm {
 /// information parsing. The actual data is supplied through pure virtual
 /// methods that a concrete implementation provides.
 class DWARFContext : public DIContext {
-  typedef SmallVector<DWARFCompileUnit *, 1> CUVector;
-  typedef SmallVector<DWARFTypeUnit *, 1> TUVector;
+  typedef SmallVector<std::unique_ptr<DWARFCompileUnit>, 1> CUVector;
+  typedef SmallVector<std::unique_ptr<DWARFTypeUnit>, 1> TUVector;
 
   CUVector CUs;
   TUVector TUs;
@@ -42,6 +42,7 @@ class DWARFContext : public DIContext {
   CUVector DWOCUs;
   TUVector DWOTUs;
   std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
+  std::unique_ptr<DWARFDebugLocDWO> LocDWO;
 
   DWARFContext(DWARFContext &) LLVM_DELETED_FUNCTION;
   DWARFContext &operator=(DWARFContext &) LLVM_DELETED_FUNCTION;
@@ -69,7 +70,6 @@ public:
   };
 
   DWARFContext() : DIContext(CK_DWARF) {}
-  virtual ~DWARFContext();
 
   static bool classof(const DIContext *DICtx) {
     return DICtx->getKind() == CK_DWARF;
@@ -131,13 +131,13 @@ public:
   /// Get the compile unit at the specified index for this compile unit.
   DWARFCompileUnit *getCompileUnitAtIndex(unsigned index) {
     parseCompileUnits();
-    return CUs[index];
+    return CUs[index].get();
   }
 
   /// Get the compile unit at the specified index for the DWO compile units.
   DWARFCompileUnit *getDWOCompileUnitAtIndex(unsigned index) {
     parseDWOCompileUnits();
-    return DWOCUs[index];
+    return DWOCUs[index].get();
   }
 
   /// Get a pointer to the parsed DebugAbbrev object.
@@ -149,6 +149,9 @@ public:
   /// Get a pointer to the parsed dwo abbreviations object.
   const DWARFDebugAbbrev *getDebugAbbrevDWO();
 
+  /// Get a pointer to the parsed DebugLoc object.
+  const DWARFDebugLocDWO *getDebugLocDWO();
+
   /// Get a pointer to the parsed DebugAranges object.
   const DWARFDebugAranges *getDebugAranges();
 
@@ -174,6 +177,7 @@ public:
   virtual const TypeSectionMap &getTypesSections() = 0;
   virtual StringRef getAbbrevSection() = 0;
   virtual const Section &getLocSection() = 0;
+  virtual const Section &getLocDWOSection() = 0;
   virtual StringRef getARangeSection() = 0;
   virtual StringRef getDebugFrameSection() = 0;
   virtual const Section &getLineSection() = 0;
@@ -217,6 +221,7 @@ class DWARFContextInMemory : public DWARFContext {
   TypeSectionMap TypesSections;
   StringRef AbbrevSection;
   Section LocSection;
+  Section LocDWOSection;
   StringRef ARangeSection;
   StringRef DebugFrameSection;
   Section LineSection;
@@ -237,17 +242,17 @@ class DWARFContextInMemory : public DWARFContext {
   StringRef RangeDWOSection;
   StringRef AddrSection;
 
-  SmallVector<MemoryBuffer*, 4> UncompressedSections;
+  SmallVector<SmallString<32>, 4> UncompressedSections;
 
 public:
-  DWARFContextInMemory(object::ObjectFile *);
-  ~DWARFContextInMemory();
+  DWARFContextInMemory(object::ObjectFile &);
   bool isLittleEndian() const override { return IsLittleEndian; }
   uint8_t getAddressSize() const override { return AddressSize; }
   const Section &getInfoSection() override { return InfoSection; }
   const TypeSectionMap &getTypesSections() override { return TypesSections; }
   StringRef getAbbrevSection() override { return AbbrevSection; }
   const Section &getLocSection() override { return LocSection; }
+  const Section &getLocDWOSection() override { return LocDWOSection; }
   StringRef getARangeSection() override { return ARangeSection; }
   StringRef getDebugFrameSection() override { return DebugFrameSection; }
   const Section &getLineSection() override { return LineSection; }