34 std::string SourceFileFullPath;
45 if (RecordedResult.empty()) {
46 if (
auto Envs = findAllChildren<PDBSymbolCompilandEnv>()) {
47 std::string EnvWorkingDir, EnvSrc;
49 while (
auto Env = Envs->getNext()) {
50 std::string Var = Env->getName();
52 EnvWorkingDir = Env->getValue();
56 EnvSrc = Env->getValue();
59 RecordedResult = EnvSrc;
63 if (!EnvWorkingDir.empty() && !EnvSrc.empty()) {
64 auto Len = EnvWorkingDir.length();
65 if (EnvWorkingDir[Len - 1] !=
'/' && EnvWorkingDir[Len - 1] !=
'\\') {
66 std::string Path = EnvWorkingDir +
"\\" + EnvSrc;
70 SourceFileFullPath = Path;
76 if (!RecordedResult.empty()) {
78 return RecordedResult;
84 return OneSrcFile->getFileName();
90 auto Details = findOneChild<PDBSymbolCompilandDetails>();
95 while (
auto File = SrcFiles->getNext()) {
96 std::string FileName =
File->getFileName();
105 return File->getFileName();
109 return SourceFileFullPath;
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
IPDBRawSymbol * RawSymbol
This class represents lattice values for constants.
std::string getSourceFileFullPath() const
void dump(PDBSymDumper &Dumper) const override
Dumps the contents of a symbol a raw_ostream.
virtual std::string getSourceFileName() const =0
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.
static void replace(Module &M, GlobalVariable *Old, GlobalVariable *New)
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
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
StringRef extension(StringRef path, Style style=Style::native)
Get extension.