[llvm] r326857 - [DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefn
Aaron Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 6 16:33:09 PST 2018
Author: asmith
Date: Tue Mar 6 16:33:09 2018
New Revision: 326857
URL: http://llvm.org/viewvc/llvm-project?rev=326857&view=rev
Log:
[DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefn
Summary: This helps to determine the line number for a PDB type with definition
Reviewers: zturner, llvm-commits, rnk
Reviewed By: zturner
Subscribers: rengolin, JDevlieghere
Differential Revision: https://reviews.llvm.org/D44119
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp
llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.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=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h Tue Mar 6 16:33:09 2018
@@ -103,6 +103,7 @@ public:
uint32_t getSizeInUdt() const override;
uint32_t getSlot() const override;
std::string getSourceFileName() const override;
+ std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
uint32_t getStride() const override;
uint32_t getSubTypeId() const override;
std::string getSymbolsFileName() const override;
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=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h Tue Mar 6 16:33:09 2018
@@ -115,6 +115,8 @@ public:
virtual uint32_t getSizeInUdt() const = 0;
virtual uint32_t getSlot() const = 0;
virtual std::string getSourceFileName() const = 0;
+ virtual std::unique_ptr<IPDBLineNumber>
+ getSrcLineOnTypeDefn() const = 0;
virtual uint32_t getStride() const = 0;
virtual uint32_t getSubTypeId() const = 0;
virtual std::string getSymbolsFileName() const = 0;
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=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h Tue Mar 6 16:33:09 2018
@@ -108,6 +108,7 @@ public:
uint32_t getSizeInUdt() const override;
uint32_t getSlot() const override;
std::string getSourceFileName() const override;
+ std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
uint32_t getStride() const override;
uint32_t getSubTypeId() const override;
std::string getSymbolsFileName() const override;
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=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp Tue Mar 6 16:33:09 2018
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/CodeView/Formatters.h"
#include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
#include "llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h"
+#include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
#include "llvm/DebugInfo/PDB/PDBExtras.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
@@ -748,6 +749,15 @@ std::string DIARawSymbol::getSourceFileN
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sourceFileName);
}
+std::unique_ptr<IPDBLineNumber>
+DIARawSymbol::getSrcLineOnTypeDefn() const {
+ CComPtr<IDiaLineNumber> LineNumber;
+ if (FAILED(Symbol->getSrcLineOnTypeDefn(&LineNumber)) || !LineNumber)
+ return nullptr;
+
+ return llvm::make_unique<DIALineNumber>(LineNumber);
+}
+
uint32_t DIARawSymbol::getStride() const {
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_stride);
}
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=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp Tue Mar 6 16:33:09 2018
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
@@ -278,6 +279,11 @@ std::string NativeRawSymbol::getSourceFi
return {};
}
+std::unique_ptr<IPDBLineNumber>
+NativeRawSymbol::getSrcLineOnTypeDefn() const {
+ return nullptr;
+}
+
uint32_t NativeRawSymbol::getStride() const {
return 0;
}
Modified: llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp?rev=326857&r1=326856&r2=326857&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp Tue Mar 6 16:33:09 2018
@@ -11,6 +11,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
@@ -195,6 +196,10 @@ public:
return {};
}
+ std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override {
+ return nullptr;
+ }
+
MOCK_SYMBOL_ACCESSOR(getAccess)
MOCK_SYMBOL_ACCESSOR(getAddressOffset)
MOCK_SYMBOL_ACCESSOR(getAddressSection)
More information about the llvm-commits
mailing list