[llvm] r298026 - Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 17:46:42 PDT 2017


Author: zturner
Date: Thu Mar 16 19:46:42 2017
New Revision: 298026

URL: http://llvm.org/viewvc/llvm-project?rev=298026&view=rev
Log:
Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"

For some reason this is causing ANSI color codes to be printed
even when run through FileCheck.

Removed:
    llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
    llvm/trunk/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp
    llvm/trunk/test/DebugInfo/PDB/Native/pdb-native-summary.test
Modified:
    llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
    llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt
    llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
    llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp

Removed: llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h?rev=298025&view=auto
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h (removed)
@@ -1,39 +0,0 @@
-//===- NativeExeSymbol.h - native impl for PDBSymbolExe ---------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVEEXESYMBOL_H
-#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEEXESYMBOL_H
-
-#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
-#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
-
-namespace llvm {
-namespace pdb {
-
-class NativeExeSymbol : public NativeRawSymbol {
-public:
-  NativeExeSymbol(NativeSession &Session);
-
-  std::unique_ptr<IPDBEnumSymbols>
-  findChildren(PDB_SymType Type) const override;
-
-  uint32_t getAge() const override;
-  std::string getSymbolsFileName() const override;
-  PDB_UniqueId getGuid() const override;
-  bool hasCTypes() const override;
-  bool hasPrivateSymbols() const override;
-
-private:
-  PDBFile &File;
-};
-
-} // namespace pdb
-} // namespace llvm
-
-#endif

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h?rev=298026&r1=298025&r2=298026&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h Thu Mar 16 19:46:42 2017
@@ -197,7 +197,7 @@ public:
   bool wasInlined() const override;
   std::string getUnused() const override;
 
-protected:
+private:
   NativeSession &Session;
 };
 

Modified: llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt?rev=298026&r1=298025&r2=298026&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt (original)
+++ llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txt Thu Mar 16 19:46:42 2017
@@ -42,7 +42,6 @@ add_pdb_impl_folder(Native
   Native/ModStream.cpp
   Native/NativeCompilandSymbol.cpp
   Native/NativeEnumModules.cpp
-  Native/NativeExeSymbol.cpp
   Native/NativeRawSymbol.cpp
   Native/NamedStreamMap.cpp
   Native/NativeSession.cpp

Removed: llvm/trunk/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp?rev=298025&view=auto
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp (removed)
@@ -1,79 +0,0 @@
-//===- NativeExeSymbol.cpp - native impl for PDBSymbolExe -------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h"
-
-#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
-#include "llvm/DebugInfo/PDB/Native/InfoStream.h"
-#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
-#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
-
-namespace llvm {
-namespace pdb {
-
-NativeExeSymbol::NativeExeSymbol(NativeSession &Session)
-    : NativeRawSymbol(Session), File(Session.getPDBFile()) {}
-
-std::unique_ptr<IPDBEnumSymbols>
-NativeExeSymbol::findChildren(PDB_SymType Type) const {
-  switch (Type) {
-  case PDB_SymType::Compiland: {
-    auto Dbi = File.getPDBDbiStream();
-    if (Dbi) {
-      const auto Modules = Dbi->modules();
-      return std::unique_ptr<IPDBEnumSymbols>(
-          new NativeEnumModules(Session, Modules));
-    }
-    consumeError(Dbi.takeError());
-    break;
-  }
-  default:
-    break;
-  }
-  return nullptr;
-}
-
-uint32_t NativeExeSymbol::getAge() const {
-  auto IS = File.getPDBInfoStream();
-  if (IS)
-    return IS->getAge();
-  consumeError(IS.takeError());
-  return 0;
-}
-
-std::string NativeExeSymbol::getSymbolsFileName() const {
-  return File.getFilePath();
-}
-
-PDB_UniqueId NativeExeSymbol::getGuid() const {
-  auto IS = File.getPDBInfoStream();
-  if (IS)
-    return IS->getGuid();
-  consumeError(IS.takeError());
-  return PDB_UniqueId{{0}};
-}
-
-bool NativeExeSymbol::hasCTypes() const {
-  auto Dbi = File.getPDBDbiStream();
-  if (Dbi)
-    return Dbi->hasCTypes();
-  consumeError(Dbi.takeError());
-  return false;
-}
-
-bool NativeExeSymbol::hasPrivateSymbols() const {
-  auto Dbi = File.getPDBDbiStream();
-  if (Dbi)
-    return !Dbi->isStripped();
-  consumeError(Dbi.takeError());
-  return false;
-}
-
-} // namespace pdb
-} // namespace llvm

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp?rev=298026&r1=298025&r2=298026&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp Thu Mar 16 19:46:42 2017
@@ -11,7 +11,11 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
+#include "llvm/DebugInfo/PDB/Native/InfoStream.h"
+#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
 #include "llvm/DebugInfo/PDB/PDBExtras.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/raw_ostream.h"
@@ -26,6 +30,21 @@ void NativeRawSymbol::dump(raw_ostream &
 
 std::unique_ptr<IPDBEnumSymbols>
 NativeRawSymbol::findChildren(PDB_SymType Type) const {
+  switch (Type) {
+  case PDB_SymType::Compiland: {
+    auto &File = Session.getPDBFile();
+    auto Dbi = File.getPDBDbiStream();
+    if (Dbi) {
+      const auto Modules = Dbi->modules();
+      return std::unique_ptr<IPDBEnumSymbols>(
+          new NativeEnumModules(Session, Modules));
+    }
+    consumeError(Dbi.takeError());
+    break;
+  }
+  default:
+    break;
+  }
   return nullptr;
 }
 
@@ -63,6 +82,11 @@ uint32_t NativeRawSymbol::getAddressSect
 }
 
 uint32_t NativeRawSymbol::getAge() const {
+  auto &File = Session.getPDBFile();
+  auto IS = File.getPDBInfoStream();
+  if (IS)
+    return IS->getAge();
+  consumeError(IS.takeError());
   return 0;
 }
 
@@ -248,7 +272,9 @@ uint32_t NativeRawSymbol::getSubTypeId()
   return 0;
 }
 
-std::string NativeRawSymbol::getSymbolsFileName() const { return ""; }
+std::string NativeRawSymbol::getSymbolsFileName() const {
+  return Session.getPDBFile().getFilePath();
+}
 
 uint32_t NativeRawSymbol::getSymIndexId() const {
   return 0;
@@ -327,6 +353,11 @@ PDB_SymType NativeRawSymbol::getSymTag()
 }
 
 PDB_UniqueId NativeRawSymbol::getGuid() const {
+  auto &File = Session.getPDBFile();
+  auto IS = File.getPDBInfoStream();
+  if (IS)
+    return IS->getGuid();
+  consumeError(IS.takeError());
   return PDB_UniqueId{{0}};
 }
 

Modified: llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp?rev=298026&r1=298025&r2=298026&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp Thu Mar 16 19:46:42 2017
@@ -13,7 +13,7 @@
 #include "llvm/DebugInfo/PDB/GenericError.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
-#include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h"
+#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Native/RawError.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
@@ -71,7 +71,7 @@ uint64_t NativeSession::getLoadAddress()
 void NativeSession::setLoadAddress(uint64_t Address) {}
 
 std::unique_ptr<PDBSymbolExe> NativeSession::getGlobalScope() {
-  auto RawSymbol = llvm::make_unique<NativeExeSymbol>(*this);
+  auto RawSymbol = llvm::make_unique<NativeRawSymbol>(*this);
   auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol)));
   std::unique_ptr<PDBSymbolExe> ExeSymbol(
     static_cast<PDBSymbolExe *>(PdbSymbol.release()));

Removed: llvm/trunk/test/DebugInfo/PDB/Native/pdb-native-summary.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/Native/pdb-native-summary.test?rev=298025&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/Native/pdb-native-summary.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/Native/pdb-native-summary.test (removed)
@@ -1,11 +0,0 @@
-; Test that the native PDB reader gets the PDB summary correct.
-; RUN: llvm-pdbdump pretty -native %p/../Inputs/empty.pdb \
-; RUN:   | FileCheck -check-prefix=EMPTY %s
-
-; Reference output was generated with the DIA reader to ensure that the
-; `-native` option produces identical output.
-
-EMPTY:  Size: 102400 bytes
-EMPTY:  Guid: {0B355641-86A0-A249-896F-9988FAE52FF0}
-EMPTY:  Age: 1
-EMPTY:  Attributes: HasPrivateSymbols




More information about the llvm-commits mailing list