LLVM  4.0.0
PDBSymbolCompiland.cpp
Go to the documentation of this file.
1 //===- PDBSymbolCompiland.cpp - compiland details --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
12 
14 
15 #include <utility>
16 
17 using namespace llvm;
18 using namespace llvm::pdb;
19 
21  std::unique_ptr<IPDBRawSymbol> Symbol)
22  : PDBSymbol(PDBSession, std::move(Symbol)) {}
23 
25  Dumper.dump(*this);
26 }
27 
29 {
30  std::string Result = RawSymbol->getSourceFileName();
31  if (!Result.empty())
32  return Result;
33  auto Envs = findAllChildren<PDBSymbolCompilandEnv>();
34  if (!Envs)
35  return std::string();
36  while (auto Env = Envs->getNext()) {
37  std::string Var = Env->getName();
38  if (Var != "src")
39  continue;
40  std::string Value = Env->getValue();
41  return Value;
42  }
43  return std::string();
44 }
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
Definition: IPDBSession.h:25
void dump(PDBSymDumper &Dumper) const override
Dumps the contents of a symbol a raw_ostream.
std::string getSourceFileName() const
const std::unique_ptr< IPDBRawSymbol > RawSymbol
Definition: PDBSymbol.h:95
PDBSymbolCompiland(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > CompilandSymbol)
PDBSymbol defines the base of the inheritance hierarchy for concrete symbol types (e...
Definition: PDBSymbol.h:43
virtual void dump(const PDBSymbolAnnotation &Symbol)
LLVM Value Representation.
Definition: Value.h:71