summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
index 74369148e26..8393b5cdfd1 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
@@ -22,3 +23,21 @@ PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession,
void PDBSymbolCompiland::dump(PDBSymDumper &Dumper) const {
Dumper.dump(*this);
}
+
+std::string PDBSymbolCompiland::getSourceFileName() const
+{
+ std::string Result = RawSymbol->getSourceFileName();
+ if (!Result.empty())
+ return Result;
+ auto Envs = findAllChildren<PDBSymbolCompilandEnv>();
+ if (!Envs)
+ return std::string();
+ while (auto Env = Envs->getNext()) {
+ std::string Var = Env->getName();
+ if (Var != "src")
+ continue;
+ std::string Value = Env->getValue();
+ return Value;
+ }
+ return std::string();
+}
OpenPOWER on IntegriCloud