summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2017-03-15 20:17:58 +0000
committerAdrian McCarthy <amccarth@google.com>2017-03-15 20:17:58 +0000
commit65d26888422a919a3d822b4b0c194022b4a6fccc (patch)
tree1b7dd020f0740fad7c2dc8344792be1a423ab50a /llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
parent9fd6ee6a7842628f72b39fa2bdacdb201a6681d8 (diff)
downloadbcm5719-llvm-65d26888422a919a3d822b4b0c194022b4a6fccc.tar.gz
bcm5719-llvm-65d26888422a919a3d822b4b0c194022b4a6fccc.zip
Introduce NativeEnumModules and NativeCompilandSymbol
Together, these allow lldb-pdbdump to list all the modules from a PDB using a native reader (rather than DIA). Note that I'll probably be specializing NativeRawSymbol in a subsequent patch. Differential Revision: https://reviews.llvm.org/D30956 llvm-svn: 297883
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
new file mode 100644
index 00000000000..24b62823eb2
--- /dev/null
+++ b/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
@@ -0,0 +1,42 @@
+//===- NativeCompilandSymbol.h - Native impl of PDBCompilandSymbol -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/NativeCompilandSymbol.h"
+
+namespace llvm {
+namespace pdb {
+
+NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
+ const ModuleInfoEx &MI)
+ : NativeRawSymbol(Session), Module(MI) {}
+
+PDB_SymType NativeCompilandSymbol::getSymTag() const {
+ return PDB_SymType::Compiland;
+}
+
+bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
+ return Module.Info.hasECInfo();
+}
+
+uint32_t NativeCompilandSymbol::getLexicalParentId() const { return 0; }
+
+// DIA, which this API was modeled after, uses counter-intuitive meanings for
+// IDiaSymbol::get_name and IDiaSymbol::get_libraryName, which is why these
+// methods may appear to be cross-mapped.
+
+std::string NativeCompilandSymbol::getLibraryName() const {
+ return Module.Info.getObjFileName();
+}
+
+std::string NativeCompilandSymbol::getName() const {
+ return Module.Info.getModuleName();
+}
+
+} // namespace pdb
+} // namespace llvm
OpenPOWER on IntegriCloud