From ff90e627bae22b44b4547189a5cd08f6505c72ff Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 3 Dec 2018 18:07:03 +0000 Subject: [PATCH] Fix non-modular build. llvm-svn: 348157 --- llvm/include/llvm/IR/DiagnosticInfo.h | 2 +- llvm/lib/IR/DiagnosticInfo.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h index e98ab29..b5ed2c7 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 fc6f5f1..3c6665b 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)) -- 2.7.4