Fix non-modular build.

llvm-svn: 348157
This commit is contained in:
Adrian Prantl 2018-12-03 18:07:03 +00:00
parent 64c8a2e312
commit ff90e627ba
2 changed files with 5 additions and 1 deletions

View File

@ -353,7 +353,7 @@ public:
/// Return the full path to the file. /// Return the full path to the file.
std::string getAbsolutePath() const; std::string getAbsolutePath() const;
/// Return the file name relative to the compilation directory. /// Return the file name relative to the compilation directory.
StringRef getRelativePath() const { return File->getFilename(); } StringRef getRelativePath() const;
unsigned getLine() const { return Line; } unsigned getLine() const { return Line; }
unsigned getColumn() const { return Column; } unsigned getColumn() const { return Column; }
}; };

View File

@ -121,6 +121,10 @@ DiagnosticLocation::DiagnosticLocation(const DISubprogram *SP) {
Column = 0; Column = 0;
} }
StringRef DiagnosticLocation::getRelativePath() const {
return File->getFilename();
}
std::string DiagnosticLocation::getAbsolutePath() const { std::string DiagnosticLocation::getAbsolutePath() const {
StringRef Name = File->getFilename(); StringRef Name = File->getFilename();
if (sys::path::is_absolute(Name)) if (sys::path::is_absolute(Name))