[llvm] r295228 - [OptDiag] Pass const Values/Types to Argument. NFC.
Ahmed Bougacha via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 12:38:28 PST 2017
Author: ab
Date: Wed Feb 15 14:38:28 2017
New Revision: 295228
URL: http://llvm.org/viewvc/llvm-project?rev=295228&view=rev
Log:
[OptDiag] Pass const Values/Types to Argument. NFC.
Modified:
llvm/trunk/include/llvm/IR/DiagnosticInfo.h
llvm/trunk/lib/IR/DiagnosticInfo.cpp
Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=295228&r1=295227&r2=295228&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Wed Feb 15 14:38:28 2017
@@ -403,8 +403,8 @@ public:
DebugLoc DLoc;
explicit Argument(StringRef Str = "") : Key("String"), Val(Str) {}
- Argument(StringRef Key, Value *V);
- Argument(StringRef Key, Type *T);
+ Argument(StringRef Key, const Value *V);
+ Argument(StringRef Key, const Type *T);
Argument(StringRef Key, int N);
Argument(StringRef Key, unsigned N);
Argument(StringRef Key, bool B) : Key(Key), Val(B ? "true" : "false") {}
Modified: llvm/trunk/lib/IR/DiagnosticInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DiagnosticInfo.cpp?rev=295228&r1=295227&r2=295228&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DiagnosticInfo.cpp (original)
+++ llvm/trunk/lib/IR/DiagnosticInfo.cpp Wed Feb 15 14:38:28 2017
@@ -171,7 +171,7 @@ const std::string DiagnosticInfoWithDebu
return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str();
}
-DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, Value *V)
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, const Value *V)
: Key(Key) {
if (auto *F = dyn_cast<Function>(V)) {
if (DISubprogram *SP = F->getSubprogram())
@@ -191,7 +191,7 @@ DiagnosticInfoOptimizationBase::Argument
Val = I->getOpcodeName();
}
-DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, Type *T)
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, const Type *T)
: Key(Key) {
raw_string_ostream OS(Val);
OS << *T;
More information about the llvm-commits
mailing list