From 67d9e19554d14ac29148a57774c83b306cc84dbc Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 17 Feb 2017 17:34:37 +0000 Subject: [PATCH] OptDiag: Rename DiagnosticInfoWithDebugLoc to WithLocation. NFC This generalizes the name in preparation for decoupling the concept from DebugLoc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295465 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DiagnosticInfo.h | 13 ++++++------- lib/IR/DiagnosticInfo.cpp | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/llvm/IR/DiagnosticInfo.h b/include/llvm/IR/DiagnosticInfo.h index 5575db36bb1..7429886a8ad 100644 --- a/include/llvm/IR/DiagnosticInfo.h +++ b/include/llvm/IR/DiagnosticInfo.h @@ -348,11 +348,11 @@ private: }; /// Common features for diagnostics with an associated DebugLoc -class DiagnosticInfoWithDebugLocBase : public DiagnosticInfo { +class DiagnosticInfoWithLocationBase : public DiagnosticInfo { public: /// \p Fn is the function where the diagnostic is being emitted. \p DLoc is /// the location information to use in the diagnostic. - DiagnosticInfoWithDebugLocBase(enum DiagnosticKind Kind, + DiagnosticInfoWithLocationBase(enum DiagnosticKind Kind, enum DiagnosticSeverity Severity, const Function &Fn, const DebugLoc &DLoc) @@ -383,7 +383,7 @@ private: /// \brief Common features for diagnostics dealing with optimization remarks /// that are used by both IR and MIR passes. -class DiagnosticInfoOptimizationBase : public DiagnosticInfoWithDebugLocBase { +class DiagnosticInfoOptimizationBase : public DiagnosticInfoWithLocationBase { public: /// \brief Used to set IsVerbose via the stream interface. struct setIsVerbose {}; @@ -419,7 +419,7 @@ public: enum DiagnosticSeverity Severity, const char *PassName, StringRef RemarkName, const Function &Fn, const DebugLoc &DLoc) - : DiagnosticInfoWithDebugLocBase(Kind, Severity, Fn, DLoc), + : DiagnosticInfoWithLocationBase(Kind, Severity, Fn, DLoc), PassName(PassName), RemarkName(RemarkName) {} DiagnosticInfoOptimizationBase &operator<<(StringRef S); @@ -908,8 +908,7 @@ public: }; /// Diagnostic information for unsupported feature in backend. -class DiagnosticInfoUnsupported - : public DiagnosticInfoWithDebugLocBase { +class DiagnosticInfoUnsupported : public DiagnosticInfoWithLocationBase { private: Twine Msg; @@ -923,7 +922,7 @@ public: DiagnosticInfoUnsupported(const Function &Fn, const Twine &Msg, DebugLoc DLoc = DebugLoc(), DiagnosticSeverity Severity = DS_Error) - : DiagnosticInfoWithDebugLocBase(DK_Unsupported, Severity, Fn, DLoc), + : DiagnosticInfoWithLocationBase(DK_Unsupported, Severity, Fn, DLoc), Msg(Msg) {} static bool classof(const DiagnosticInfo *DI) { diff --git a/lib/IR/DiagnosticInfo.cpp b/lib/IR/DiagnosticInfo.cpp index ad172486d37..9de3377cc47 100644 --- a/lib/IR/DiagnosticInfo.cpp +++ b/lib/IR/DiagnosticInfo.cpp @@ -148,11 +148,11 @@ void DiagnosticInfoPGOProfile::print(DiagnosticPrinter &DP) const { DP << getMsg(); } -bool DiagnosticInfoWithDebugLocBase::isLocationAvailable() const { +bool DiagnosticInfoWithLocationBase::isLocationAvailable() const { return getDebugLoc(); } -void DiagnosticInfoWithDebugLocBase::getLocation(StringRef *Filename, +void DiagnosticInfoWithLocationBase::getLocation(StringRef *Filename, unsigned *Line, unsigned *Column) const { DILocation *L = getDebugLoc(); @@ -162,7 +162,7 @@ void DiagnosticInfoWithDebugLocBase::getLocation(StringRef *Filename, *Column = L->getColumn(); } -const std::string DiagnosticInfoWithDebugLocBase::getLocationStr() const { +const std::string DiagnosticInfoWithLocationBase::getLocationStr() const { StringRef Filename(""); unsigned Line = 0; unsigned Column = 0; -- 2.50.1