diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2018-12-04 16:30:31 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2018-12-04 16:30:31 +0000 |
commit | 449a7f0dbb621edf2a6351924a170e268ec6957d (patch) | |
tree | 9b51c5b6c4f9f19063fd565b8152db640726482e /llvm/lib/IR | |
parent | 65034b8698851e22d03b2c4f51fe12df957a5279 (diff) | |
download | bcm5719-llvm-449a7f0dbb621edf2a6351924a170e268ec6957d.tar.gz bcm5719-llvm-449a7f0dbb621edf2a6351924a170e268ec6957d.zip |
Revert "Adapt gcov to changes in CFE."
This reverts commit r348203.
Reason: this produces absolute paths in .gcno files, breaking us
internally as we rely on them being consistent with the filenames passed
in the command line.
Also reverts r348157 and r348155 to account for revert of r348154 in
clang repository.
llvm-svn: 348279
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/DiagnosticInfo.cpp | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp index 3c6665bbcb7..5ddb1196b07 100644 --- a/llvm/lib/IR/DiagnosticInfo.cpp +++ b/llvm/lib/IR/DiagnosticInfo.cpp @@ -33,10 +33,9 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/Path.h" #include "llvm/Support/Regex.h" -#include "llvm/Support/ScopedPrinter.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/ScopedPrinter.h" #include <atomic> #include <cassert> #include <memory> @@ -107,7 +106,7 @@ void DiagnosticInfoPGOProfile::print(DiagnosticPrinter &DP) const { DiagnosticLocation::DiagnosticLocation(const DebugLoc &DL) { if (!DL) return; - File = DL->getFile(); + Filename = DL->getFilename(); Line = DL->getLine(); Column = DL->getColumn(); } @@ -115,36 +114,17 @@ DiagnosticLocation::DiagnosticLocation(const DebugLoc &DL) { DiagnosticLocation::DiagnosticLocation(const DISubprogram *SP) { if (!SP) return; - - File = SP->getFile(); + Filename = SP->getFilename(); Line = SP->getScopeLine(); Column = 0; } -StringRef DiagnosticLocation::getRelativePath() const { - return File->getFilename(); -} - -std::string DiagnosticLocation::getAbsolutePath() const { - StringRef Name = File->getFilename(); - if (sys::path::is_absolute(Name)) - return Name; - - SmallString<128> Path; - sys::path::append(Path, File->getDirectory(), Name); - return sys::path::remove_leading_dotslash(Path).str(); -} - -std::string DiagnosticInfoWithLocationBase::getAbsolutePath() const { - return Loc.getAbsolutePath(); -} - -void DiagnosticInfoWithLocationBase::getLocation(StringRef &RelativePath, - unsigned &Line, - unsigned &Column) const { - RelativePath = Loc.getRelativePath(); - Line = Loc.getLine(); - Column = Loc.getColumn(); +void DiagnosticInfoWithLocationBase::getLocation(StringRef *Filename, + unsigned *Line, + unsigned *Column) const { + *Filename = Loc.getFilename(); + *Line = Loc.getLine(); + *Column = Loc.getColumn(); } const std::string DiagnosticInfoWithLocationBase::getLocationStr() const { @@ -152,7 +132,7 @@ const std::string DiagnosticInfoWithLocationBase::getLocationStr() const { unsigned Line = 0; unsigned Column = 0; if (isLocationAvailable()) - getLocation(Filename, Line, Column); + getLocation(&Filename, &Line, &Column); return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str(); } @@ -419,7 +399,7 @@ template <> struct MappingTraits<DiagnosticLocation> { static void mapping(IO &io, DiagnosticLocation &DL) { assert(io.outputting() && "input not yet implemented"); - StringRef File = DL.getRelativePath(); + StringRef File = DL.getFilename(); unsigned Line = DL.getLine(); unsigned Col = DL.getColumn(); |