summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2018-03-19 21:18:39 +0000
committerAaron Smith <aaron.smith@microsoft.com>2018-03-19 21:18:39 +0000
commit06173e8b46d4881c3d48f782dc1674fa351dff85 (patch)
treef1b287224f4c05319637d95600bd1c2ad885dba9 /llvm/lib/DebugInfo
parente664b5dc9dae36c380494bacecab33b7dca5b13e (diff)
downloadbcm5719-llvm-06173e8b46d4881c3d48f782dc1674fa351dff85.tar.gz
bcm5719-llvm-06173e8b46d4881c3d48f782dc1674fa351dff85.zip
[PDB] Add exclusive methods to derived symbol class
Summary: This commit adds two methods to the PDBSymboFunc class used in parsing symbols. getLineNumbers() is used to determine a Function symbol's declaration and getCompilandId() is used to initialize the SymbolContext field sc.comp_unit. Reviewers: zturner, rnk, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D44457 llvm-svn: 327909
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
index c8c44d97e2f..37ca1abe86e 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp
@@ -105,3 +105,18 @@ bool PDBSymbolFunc::isDestructor() const {
return true;
return false;
}
+
+std::unique_ptr<IPDBEnumLineNumbers> PDBSymbolFunc::getLineNumbers() const {
+ auto Len = RawSymbol->getLength();
+ return Session.findLineNumbersByAddress(RawSymbol->getVirtualAddress(),
+ Len ? Len : 1);
+}
+
+uint32_t PDBSymbolFunc::getCompilandId() const {
+ if (auto Lines = getLineNumbers()) {
+ if (auto FirstLine = Lines->getNext()) {
+ return FirstLine->getCompilandId();
+ }
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud