]> granicus.if.org Git - llvm/commitdiff
OptDiag: Rename DiagnosticInfoWithDebugLoc to WithLocation. NFC
authorJustin Bogner <mail@justinbogner.com>
Fri, 17 Feb 2017 17:34:37 +0000 (17:34 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 17 Feb 2017 17:34:37 +0000 (17:34 +0000)
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
lib/IR/DiagnosticInfo.cpp

index 5575db36bb1cceff02ba6ae02e954c383fef480c..7429886a8ad355ab87f1f2412ec408691d184904 100644 (file)
@@ -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) {
index ad172486d378580d74f197a1832a2ef90f4c9ace..9de3377cc47a0d3c70a390a631afbac95e12641d 100644 (file)
@@ -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("<unknown>");
   unsigned Line = 0;
   unsigned Column = 0;