diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
tree | 4def12e759965de927d963ac65840d663ef9d1ea /lib/DebugInfo/PDB/PDBSymbolCompiland.cpp | |
parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) |
Diffstat (limited to 'lib/DebugInfo/PDB/PDBSymbolCompiland.cpp')
-rw-r--r-- | lib/DebugInfo/PDB/PDBSymbolCompiland.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp b/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp index 74369148e26e5..ebff08846cace 100644 --- a/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp +++ b/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp @@ -8,12 +8,14 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" +#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h" #include "llvm/DebugInfo/PDB/PDBSymDumper.h" #include <utility> using namespace llvm; +using namespace llvm::pdb; PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol) @@ -22,3 +24,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(); +} |