[C++11] Introduce ObjectFile::symbols() to use range-based loops.
[oota-llvm.git] / tools / llvm-symbolizer / LLVMSymbolize.h
index d1f2285aa8a8cc3bf0f81240e47831921966a2bd..288be8022e732a9fa74b0a145a41afe94c10fd44 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef LLVM_SYMBOLIZE_H
 #define LLVM_SYMBOLIZE_H
 
-#include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/Object/MachOUniversal.h"
@@ -48,6 +47,9 @@ public:
   };
 
   LLVMSymbolizer(const Options &Opts = Options()) : Opts(Opts) {}
+  ~LLVMSymbolizer() {
+    flush();
+  }
 
   // Returns the result of symbolization for module name/offset as
   // a string (possibly containing newlines).
@@ -99,8 +101,9 @@ private:
   bool getNameFromSymbolTable(SymbolRef::Type Type, uint64_t Address,
                               std::string &Name, uint64_t &Addr,
                               uint64_t &Size) const;
+  void addSymbol(const SymbolRef &Symbol);
   ObjectFile *Module;
-  OwningPtr<DIContext> DebugInfoContext;
+  std::unique_ptr<DIContext> DebugInfoContext;
 
   struct SymbolDesc {
     uint64_t Addr;