[llvm] r230204 - [llvm-pdbdump] Very minor code cleanup.

Zachary Turner zturner at google.com
Sun Feb 22 21:59:14 PST 2015


Author: zturner
Date: Sun Feb 22 23:59:14 2015
New Revision: 230204

URL: http://llvm.org/viewvc/llvm-project?rev=230204&view=rev
Log:
[llvm-pdbdump] Very minor code cleanup.

This just removes some dead enums as well as some debug flushes
of stdout.

Modified:
    llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
    llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
    llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
    llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h
    llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h
    llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp
    llvm/trunk/lib/DebugInfo/PDB/IPDBSourceFile.cpp
    llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
    llvm/trunk/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
    llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp
    llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp
    llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp
    llvm/trunk/tools/llvm-pdbdump/VariableDumper.cpp
    llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h Sun Feb 22 23:59:14 2015
@@ -19,7 +19,7 @@ class DIARawSymbol : public IPDBRawSymbo
 public:
   DIARawSymbol(const DIASession &PDBSession, CComPtr<IDiaSymbol> DiaSymbol);
 
-  void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override;
+  void dump(raw_ostream &OS, int Indent) const override;
 
   CComPtr<IDiaSymbol> getDiaSymbol() const { return Symbol; }
 

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h Sun Feb 22 23:59:14 2015
@@ -28,7 +28,7 @@ class IPDBRawSymbol {
 public:
   virtual ~IPDBRawSymbol();
 
-  virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const = 0;
+  virtual void dump(raw_ostream &OS, int Indent) const = 0;
 
   virtual std::unique_ptr<IPDBEnumSymbols>
   findChildren(PDB_SymType Type) const = 0;

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSourceFile.h?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSourceFile.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSourceFile.h Sun Feb 22 23:59:14 2015
@@ -24,7 +24,7 @@ class IPDBSourceFile {
 public:
   virtual ~IPDBSourceFile();
 
-  void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
+  void dump(raw_ostream &OS, int Indent) const;
 
   virtual std::string getFileName() const = 0;
   virtual uint32_t getUniqueId() const = 0;

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBSymbol.h Sun Feb 22 23:59:14 2015
@@ -55,7 +55,7 @@ public:
   /// override the behavior to only dump known fields.
   virtual void dump(raw_ostream &OS, int Indent,
                     PDBSymDumper &Dumper) const = 0;
-  void defaultDump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
+  void defaultDump(raw_ostream &OS, int Indent) const;
 
   PDB_SymType getSymTag() const;
 

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h Sun Feb 22 23:59:14 2015
@@ -67,50 +67,6 @@ enum class PDB_ReaderType {
   DIA = 0,
 };
 
-enum class PDB_DumpLevel {
-  Compact,
-  Normal,
-  Detailed,
-};
-
-enum PDB_DumpFlags {
-  PDB_DF_None = 0x0,
-  PDB_DF_Functions = 0x1,  // Dump functions
-  PDB_DF_Data = 0x2,       // Dump variables and constants
-  PDB_DF_Labels = 0x4,     // Dump labels
-  PDB_DF_PublicSyms = 0x8, // Dump public symbols
-  PDB_DF_Classes = 0x10,   // Dump class types
-  PDB_DF_Enums = 0x20,     // Dump enums
-  PDB_DF_Funcsigs = 0x40,  // Dump function signatures
-  PDB_DF_VTables = 0x80,   // Dump virtual function tables
-  PDB_DF_Thunks = 0x100,   // Dump thunks
-  PDB_DF_ObjFiles = 0x200, // Dump object files (compilands)
-  PDB_DF_Typedefs = 0x400, // Dump typedefs
-  PDB_DF_Children = 0x800, // Dump children of the current symbol
-  PDB_DF_Hidden = 0x1000,  // Dump everything.  This is not simply a bitwise
-                           // or of the previous flags.  It will find symbols
-                           // that would otherwise be missed, but can lead to
-                           // much slower dumps for large input files.
-  PDB_DF_All = 0x7FF
-};
-inline PDB_DumpFlags operator|(PDB_DumpFlags LHS, PDB_DumpFlags RHS) {
-  return static_cast<PDB_DumpFlags>((int)LHS | (int)RHS);
-}
-
-inline PDB_DumpFlags operator&(PDB_DumpFlags LHS, PDB_DumpFlags RHS) {
-  return static_cast<PDB_DumpFlags>((int)LHS & (int)RHS);
-}
-
-inline PDB_DumpFlags operator~(PDB_DumpFlags LHS) {
-  return static_cast<PDB_DumpFlags>(~(int)LHS);
-}
-inline PDB_DumpFlags &operator|=(PDB_DumpFlags &LHS, PDB_DumpFlags RHS) {
-  return (LHS = (LHS | RHS));
-}
-inline PDB_DumpFlags &operator&=(PDB_DumpFlags &LHS, PDB_DumpFlags RHS) {
-  return (LHS = (LHS & RHS));
-}
-
 /// Defines a 128-bit unique identifier.  This maps to a GUID on Windows, but
 /// is abstracted here for the purposes of non-Windows platforms that don't have
 /// the GUID structure defined.

Modified: llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp Sun Feb 22 23:59:14 2015
@@ -179,8 +179,7 @@ DIARawSymbol::DIARawSymbol(const DIASess
 #define RAW_METHOD_DUMP(Stream, Method)                                        \
   DumpDIAValue(Stream, Indent, StringRef(#Method), Symbol, &IDiaSymbol::Method);
 
-void DIARawSymbol::dump(raw_ostream &OS, int Indent,
-                        PDB_DumpLevel Level) const {
+void DIARawSymbol::dump(raw_ostream &OS, int Indent) const {
   RAW_METHOD_DUMP(OS, get_access)
   RAW_METHOD_DUMP(OS, get_addressOffset)
   RAW_METHOD_DUMP(OS, get_addressSection)

Modified: llvm/trunk/lib/DebugInfo/PDB/IPDBSourceFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/IPDBSourceFile.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/IPDBSourceFile.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/IPDBSourceFile.cpp Sun Feb 22 23:59:14 2015
@@ -17,19 +17,16 @@ using namespace llvm;
 
 IPDBSourceFile::~IPDBSourceFile() {}
 
-void IPDBSourceFile::dump(raw_ostream &OS, int Indent,
-                          PDB_DumpLevel Level) const {
-  if (Level == PDB_DumpLevel::Compact) {
-    OS.indent(Indent);
-    PDB_Checksum ChecksumType = getChecksumType();
-    OS << "[";
-    if (ChecksumType != PDB_Checksum::None) {
-      OS << ChecksumType << ": ";
-      std::string Checksum = getChecksum();
-      for (uint8_t c : Checksum)
-        OS << format_hex_no_prefix(c, 2, true);
-    } else
-      OS << "No checksum";
-    OS << "] " << getFileName() << "\n";
-  }
+void IPDBSourceFile::dump(raw_ostream &OS, int Indent) const {
+  OS.indent(Indent);
+  PDB_Checksum ChecksumType = getChecksumType();
+  OS << "[";
+  if (ChecksumType != PDB_Checksum::None) {
+    OS << ChecksumType << ": ";
+    std::string Checksum = getChecksum();
+    for (uint8_t c : Checksum)
+      OS << format_hex_no_prefix(c, 2, true);
+  } else
+    OS << "No checksum";
+  OS << "] " << getFileName() << "\n";
 }

Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbol.cpp Sun Feb 22 23:59:14 2015
@@ -107,9 +107,8 @@ PDBSymbol::create(const IPDBSession &PDB
 
 #define ELSE_TRY_DUMP_TYPE(Type, Dumper) else TRY_DUMP_TYPE(Type, Dumper)
 
-void PDBSymbol::defaultDump(raw_ostream &OS, int Indent,
-                            PDB_DumpLevel Level) const {
-  RawSymbol->dump(OS, Indent, Level);
+void PDBSymbol::defaultDump(raw_ostream &OS, int Indent) const {
+  RawSymbol->dump(OS, Indent);
 }
 
 PDB_SymType PDBSymbol::getSymTag() const { return RawSymbol->getSymTag(); }

Modified: llvm/trunk/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/ClassDefinitionDumper.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/ClassDefinitionDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/ClassDefinitionDumper.cpp Sun Feb 22 23:59:14 2015
@@ -85,7 +85,6 @@ void ClassDefinitionDumper::start(const
   if (Count > 0)
     OS << newline(Indent);
   OS << "}";
-  OS.flush();
 }
 
 int ClassDefinitionDumper::dumpAccessGroup(PDB_MemberAccess Access,
@@ -147,7 +146,6 @@ void ClassDefinitionDumper::dump(const P
   OS << newline(Indent);
   TypedefDumper Dumper;
   Dumper.start(Symbol, OS, Indent);
-  OS.flush();
 }
 
 void ClassDefinitionDumper::dump(const PDBSymbolTypeUDT &Symbol,

Modified: llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp Sun Feb 22 23:59:14 2015
@@ -163,7 +163,6 @@ void FunctionDumper::start(const PDBSymb
         OS << ", ";
     }
   }
-  OS.flush();
   OS << ")";
   if (Symbol.isConstType())
     OS << " const";
@@ -202,8 +201,7 @@ void FunctionDumper::dump(const PDBSymbo
                           raw_ostream &OS, int Indent) {
   // PDBSymbolTypeFunctionArg is just a shim over the real argument.  Just drill
   // through to the real thing and dump it.
-  Symbol.defaultDump(OS, Indent, PDB_DumpLevel::Detailed);
-  OS.flush();
+  Symbol.defaultDump(OS, Indent);
   uint32_t TypeId = Symbol.getTypeId();
   auto Type = Symbol.getSession().getSymbolById(TypeId);
   if (!Type)

Modified: llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/TypeDumper.cpp Sun Feb 22 23:59:14 2015
@@ -78,7 +78,6 @@ void TypeDumper::dump(const PDBSymbolTyp
 
   TypedefDumper Dumper;
   Dumper.start(Symbol, OS, Indent);
-  OS.flush();
 }
 
 void TypeDumper::dump(const PDBSymbolTypeUDT &Symbol, raw_ostream &OS,

Modified: llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/TypedefDumper.cpp Sun Feb 22 23:59:14 2015
@@ -66,7 +66,6 @@ void TypedefDumper::dump(const PDBSymbol
       Pointer = FunctionDumper::PointerType::Reference;
     FunctionDumper NestedDumper;
     NestedDumper.start(*FuncSig, Pointer, OS);
-    OS.flush();
   } else {
     PointeeType->dump(OS, Indent, *this);
     OS << ((Symbol.isReference()) ? "&" : "*");

Modified: llvm/trunk/tools/llvm-pdbdump/VariableDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/VariableDumper.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/VariableDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/VariableDumper.cpp Sun Feb 22 23:59:14 2015
@@ -48,7 +48,6 @@ void VariableDumper::start(const PDBSymb
   case PDB_LocType::ThisRel: {
     int Offset = Var.getOffset();
     OS << "+" << format_hex(Var.getOffset(), 4) << " ";
-    OS.flush();
     dumpSymbolTypeAndName(*VarType, Var.getName(), OS);
     break;
   }

Modified: llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp?rev=230204&r1=230203&r2=230204&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp Sun Feb 22 23:59:14 2015
@@ -90,7 +90,7 @@ public:
   MockRawSymbol(PDB_SymType SymType)
       : Type(SymType) {}
 
-  void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override {}
+  void dump(raw_ostream &OS, int Indent) const override {}
 
   std::unique_ptr<IPDBEnumSymbols>
   findChildren(PDB_SymType Type) const override {





More information about the llvm-commits mailing list