summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/DiagnosticInfo.h2
-rw-r--r--llvm/lib/IR/DiagnosticInfo.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index e98ab29ec30..b5ed2c7d509 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -353,7 +353,7 @@ public:
/// Return the full path to the file.
std::string getAbsolutePath() const;
/// Return the file name relative to the compilation directory.
- StringRef getRelativePath() const { return File->getFilename(); }
+ StringRef getRelativePath() const;
unsigned getLine() const { return Line; }
unsigned getColumn() const { return Column; }
};
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp
index fc6f5f1c758..3c6665bbcb7 100644
--- a/llvm/lib/IR/DiagnosticInfo.cpp
+++ b/llvm/lib/IR/DiagnosticInfo.cpp
@@ -121,6 +121,10 @@ DiagnosticLocation::DiagnosticLocation(const DISubprogram *SP) {
Column = 0;
}
+StringRef DiagnosticLocation::getRelativePath() const {
+ return File->getFilename();
+}
+
std::string DiagnosticLocation::getAbsolutePath() const {
StringRef Name = File->getFilename();
if (sys::path::is_absolute(Name))
OpenPOWER on IntegriCloud