r307143 - Add const to reference arguments of Diagnostic ctor

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 04:45:09 PDT 2017


Author: alexfh
Date: Wed Jul  5 04:45:09 2017
New Revision: 307143

URL: http://llvm.org/viewvc/llvm-project?rev=307143&view=rev
Log:
Add const to reference arguments of Diagnostic ctor

Modified:
    cfe/trunk/include/clang/Tooling/Core/Diagnostic.h
    cfe/trunk/lib/Tooling/Core/Diagnostic.cpp

Modified: cfe/trunk/include/clang/Tooling/Core/Diagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Core/Diagnostic.h?rev=307143&r1=307142&r2=307143&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/Core/Diagnostic.h (original)
+++ cfe/trunk/include/clang/Tooling/Core/Diagnostic.h Wed Jul  5 04:45:09 2017
@@ -58,9 +58,9 @@ struct Diagnostic {
   Diagnostic(llvm::StringRef DiagnosticName, Level DiagLevel,
              StringRef BuildDirectory);
 
-  Diagnostic(llvm::StringRef DiagnosticName, DiagnosticMessage &Message,
-             llvm::StringMap<Replacements> &Fix,
-             SmallVector<DiagnosticMessage, 1> &Notes, Level DiagLevel,
+  Diagnostic(llvm::StringRef DiagnosticName, const DiagnosticMessage &Message,
+             const llvm::StringMap<Replacements> &Fix,
+             const SmallVector<DiagnosticMessage, 1> &Notes, Level DiagLevel,
              llvm::StringRef BuildDirectory);
 
   /// \brief Name identifying the Diagnostic.

Modified: cfe/trunk/lib/Tooling/Core/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/Diagnostic.cpp?rev=307143&r1=307142&r2=307143&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Core/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Tooling/Core/Diagnostic.cpp Wed Jul  5 04:45:09 2017
@@ -35,9 +35,9 @@ Diagnostic::Diagnostic(llvm::StringRef D
       BuildDirectory(BuildDirectory) {}
 
 Diagnostic::Diagnostic(llvm::StringRef DiagnosticName,
-                       DiagnosticMessage &Message,
-                       llvm::StringMap<Replacements> &Fix,
-                       SmallVector<DiagnosticMessage, 1> &Notes,
+                       const DiagnosticMessage &Message,
+                       const llvm::StringMap<Replacements> &Fix,
+                       const SmallVector<DiagnosticMessage, 1> &Notes,
                        Level DiagLevel, llvm::StringRef BuildDirectory)
     : DiagnosticName(DiagnosticName), Message(Message), Fix(Fix), Notes(Notes),
       DiagLevel(DiagLevel), BuildDirectory(BuildDirectory) {}




More information about the cfe-commits mailing list