[PDB] Support executables and source/line info.
[oota-llvm.git] / lib / DebugInfo / PDB / PDBSymbolTypeEnum.cpp
index cc84b1cbee022f79a9152cef194efef66c2d35f4..8dd26a342e73c7820a6d22d15d3470646af9981c 100644 (file)
@@ -7,11 +7,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <utility>
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
 
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
-#include "llvm/DebugInfo/PDB/PDBSymbol.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
+
+#include <utility>
 
 using namespace llvm;
 
@@ -19,18 +22,13 @@ PDBSymbolTypeEnum::PDBSymbolTypeEnum(const IPDBSession &PDBSession,
                                      std::unique_ptr<IPDBRawSymbol> Symbol)
     : PDBSymbol(PDBSession, std::move(Symbol)) {}
 
-void PDBSymbolTypeEnum::dump(raw_ostream &OS, int Indent,
-                             PDB_DumpLevel Level) const {
-  OS << stream_indent(Indent);
-  if (Level >= PDB_DumpLevel::Normal)
-    OS << "enum ";
-
-  uint32_t ClassId = getClassParentId();
-  if (ClassId != 0) {
-    if (auto ClassParent = Session.getSymbolById(ClassId)) {
-      ClassParent->dump(OS, 0, Level);
-      OS << "::";
-    }
-  }
-  OS << getName();
+std::unique_ptr<PDBSymbolTypeUDT> PDBSymbolTypeEnum::getClassParent() const {
+  return Session.getConcreteSymbolById<PDBSymbolTypeUDT>(getClassParentId());
+}
+
+std::unique_ptr<PDBSymbolTypeBuiltin>
+PDBSymbolTypeEnum::getUnderlyingType() const {
+  return Session.getConcreteSymbolById<PDBSymbolTypeBuiltin>(getTypeId());
 }
+
+void PDBSymbolTypeEnum::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }