LLVM  5.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  assert(RawSymbol->getSymTag() == PDB_SymType::Compiland);
24 }
25 
27  Dumper.dump(*this);
28 }
29 
31 {
32  std::string Result = RawSymbol->getSourceFileName();
33  if (!Result.empty())
34  return Result;
35  auto Envs = findAllChildren<PDBSymbolCompilandEnv>();
36  if (!Envs)
37  return std::string();
38  while (auto Env = Envs->getNext()) {
39  std::string Var = Env->getName();
40  if (Var != "src")
41  continue;
42  std::string Value = Env->getValue();
43  return Value;
44  }
45  return std::string();
46 }
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
Definition: IPDBSession.h:26
void dump(PDBSymDumper &Dumper) const override
Dumps the contents of a symbol a raw_ostream.
std::string getSourceFileName() const
std::unique_ptr< IPDBRawSymbol > RawSymbol
Definition: PDBSymbol.h:134
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:61
virtual void dump(const PDBSymbolAnnotation &Symbol)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:73