26 std::unique_ptr<IPDBRawSymbol>
Symbol)
40 std::string SourceFileFullPath;
49 std::string RecordedResult =
RawSymbol->getSourceFileName();
51 if (RecordedResult.empty()) {
52 if (
auto Envs = findAllChildren<PDBSymbolCompilandEnv>()) {
53 std::string EnvWorkingDir, EnvSrc;
55 while (
auto Env = Envs->getNext()) {
56 std::string Var = Env->getName();
58 EnvWorkingDir = Env->getValue();
62 EnvSrc = Env->getValue();
65 RecordedResult = EnvSrc;
69 if (!EnvWorkingDir.empty() && !EnvSrc.empty()) {
70 auto Len = EnvWorkingDir.length();
71 if (EnvWorkingDir[Len - 1] !=
'/' && EnvWorkingDir[Len - 1] !=
'\\') {
72 std::string Path = EnvWorkingDir +
"\\" + EnvSrc;
76 SourceFileFullPath = Path;
82 if (!RecordedResult.empty()) {
84 return RecordedResult;
90 return OneSrcFile->getFileName();
96 auto Details = findOneChild<PDBSymbolCompilandDetails>();
101 while (
auto File = SrcFiles->getNext()) {
102 std::string FileName =
File->getFileName();
111 return File->getFileName();
115 return SourceFileFullPath;
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Compute iterated dominance frontiers using a linear time algorithm.
std::string getSourceFileFullPath() const
void dump(PDBSymDumper &Dumper) const override
Dumps the contents of a symbol a raw_ostream.
std::unique_ptr< IPDBRawSymbol > RawSymbol
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
virtual std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const =0
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
A switch()-like statement whose cases are string literals.
PDBSymbolCompiland(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > CompilandSymbol)
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
PDBSymbol defines the base of the inheritance hierarchy for concrete symbol types (e...
virtual std::unique_ptr< IPDBSourceFile > findOneSourceFile(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
std::string getSourceFileName() const
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
virtual void dump(const PDBSymbolAnnotation &Symbol)
const IPDBSession & Session
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static Expected< std::string > replace(StringRef S, StringRef From, StringRef To)
StringRef extension(StringRef path, Style style=Style::native)
Get extension.