From 426d57c13462eced1cfe907e73d8f0ca17837805 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 27 Jul 2017 16:54:13 +0000 Subject: [PATCH] [OptRemark] Allow streaming of 64-bit integers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309293 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DiagnosticInfo.h | 2 ++ lib/CodeGen/PrologEpilogInserter.cpp | 2 +- lib/IR/DiagnosticInfo.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/llvm/IR/DiagnosticInfo.h b/include/llvm/IR/DiagnosticInfo.h index 15d33257711..c0bfe681e05 100644 --- a/include/llvm/IR/DiagnosticInfo.h +++ b/include/llvm/IR/DiagnosticInfo.h @@ -420,7 +420,9 @@ public: Argument(StringRef Key, const Value *V); Argument(StringRef Key, const Type *T); Argument(StringRef Key, int N); + Argument(StringRef Key, int64_t N); Argument(StringRef Key, unsigned N); + Argument(StringRef Key, uint64_t N); Argument(StringRef Key, bool B) : Key(Key), Val(B ? "true" : "false") {} }; diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index b9a1010e46f..63c839fcb0b 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -963,7 +963,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) { MachineOptimizationRemarkAnalysis R( DEBUG_TYPE, "StackSize", Fn.getFunction()->getSubprogram(), &Fn.front()); - R << ore::NV("NumStackBytes", static_cast(StackSize)) + R << ore::NV("NumStackBytes", StackSize) << " stack bytes in function"; ORE->emit(R); } diff --git a/lib/IR/DiagnosticInfo.cpp b/lib/IR/DiagnosticInfo.cpp index 5129d6b9b00..6feeb2911e3 100644 --- a/lib/IR/DiagnosticInfo.cpp +++ b/lib/IR/DiagnosticInfo.cpp @@ -221,9 +221,15 @@ DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, const Type *T) DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, int N) : Key(Key), Val(itostr(N)) {} +DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, int64_t N) + : Key(Key), Val(itostr(N)) {} + DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, unsigned N) : Key(Key), Val(utostr(N)) {} +DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, uint64_t N) + : Key(Key), Val(utostr(N)) {} + void DiagnosticInfoOptimizationBase::print(DiagnosticPrinter &DP) const { DP << getLocationStr() << ": " << getMsg(); if (Hotness) -- 2.50.1