33 std::string SourceFileFullPath;
44 if (RecordedResult.empty()) {
45 if (
auto Envs = findAllChildren<PDBSymbolCompilandEnv>()) {
46 std::string EnvWorkingDir, EnvSrc;
48 while (
auto Env = Envs->getNext()) {
49 std::string Var = Env->getName();
51 EnvWorkingDir = Env->getValue();
55 EnvSrc = Env->getValue();
58 RecordedResult = EnvSrc;
62 if (!EnvWorkingDir.empty() && !EnvSrc.empty()) {
63 auto Len = EnvWorkingDir.length();
64 if (EnvWorkingDir[Len - 1] !=
'/' && EnvWorkingDir[Len - 1] !=
'\\') {
65 std::string Path = EnvWorkingDir +
"\\" + EnvSrc;
69 SourceFileFullPath = Path;
75 if (!RecordedResult.empty()) {
77 return RecordedResult;
83 return OneSrcFile->getFileName();
89 auto Details = findOneChild<PDBSymbolCompilandDetails>();
93 while (
auto File = SrcFiles->getNext()) {
94 std::string FileName =
File->getFileName();
104 return File->getFileName();
108 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.
StringSwitch & Case(StringLiteral S, T Value)
virtual std::string getSourceFileName() const =0
LLVM_NODISCARD R Default(T Value)
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
virtual std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const =0
A switch()-like statement whose cases are string literals.
Instrumentation for Order File
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
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.