Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
[oota-llvm.git] / include / llvm / DebugInfo / PDB / PDBSymbol.h
index ada3ab38994b425bd54b690d04b3375844f89739..95bc7fd44ec9e2ff2c3f33b486874c6e4133e659 100644 (file)
 #define LLVM_DEBUGINFO_PDB_IPDBSYMBOL_H
 
 #include <memory>
+#include <unordered_map>
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
 
 #include "IPDBRawSymbol.h"
+#include "PDBExtras.h"
 #include "PDBTypes.h"
 
 #define FORWARD_SYMBOL_METHOD(MethodName)                                      \
@@ -48,10 +50,12 @@ public:
   /// call dump() on the underlying RawSymbol, which allows us to discover
   /// unknown properties, but individual implementations of PDBSymbol may
   /// override the behavior to only dump known fields.
-  virtual void dump(llvm::raw_ostream &OS) const;
+  virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const = 0;
+  void defaultDump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
 
   PDB_SymType getSymTag() const;
 
+  std::unique_ptr<IPDBEnumSymbols> findChildren(PDB_SymType Type) const;
   std::unique_ptr<IPDBEnumSymbols>
   findChildren(PDB_SymType Type, StringRef Name,
                PDB_NameSearchFlags Flags) const;
@@ -61,7 +65,12 @@ public:
                                                      uint32_t RVA) const;
   std::unique_ptr<IPDBEnumSymbols> findInlineFramesByRVA(uint32_t RVA) const;
 
+  const IPDBRawSymbol &getRawSymbol() const { return *RawSymbol; }
+  IPDBRawSymbol &getRawSymbol() { return *RawSymbol; }
+
 protected:
+  std::unique_ptr<IPDBEnumSymbols> getChildStats(TagStats &Stats) const;
+
   const IPDBSession &Session;
   const std::unique_ptr<IPDBRawSymbol> RawSymbol;
 };