diff options
author | Justin Bogner <mail@justinbogner.com> | 2017-02-22 07:38:17 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2017-02-22 07:38:17 +0000 |
commit | 8281c81413c8d8b02e8be575c4df8e336486a5f8 (patch) | |
tree | e8a834671796cdeee0e13a8a446f0d85959d8c28 /llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp | |
parent | b672722810c01ed43c2e799c0db9a0bcc3c276f3 (diff) | |
download | bcm5719-llvm-8281c81413c8d8b02e8be575c4df8e336486a5f8.tar.gz bcm5719-llvm-8281c81413c8d8b02e8be575c4df8e336486a5f8.zip |
OptDiag: Add const to some interfaces that don't modify anything. NFC
This needed a const_cast for the dominator tree recalculation in
OptimizationRemarkEmitter, but we do that all over the place already
and it's safe.
llvm-svn: 295812
Diffstat (limited to 'llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp index 7198e474d4b..23199746c40 100644 --- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -23,14 +23,14 @@ using namespace llvm; -OptimizationRemarkEmitter::OptimizationRemarkEmitter(Function *F) +OptimizationRemarkEmitter::OptimizationRemarkEmitter(const Function *F) : F(F), BFI(nullptr) { if (!F->getContext().getDiagnosticHotnessRequested()) return; // First create a dominator tree. DominatorTree DT; - DT.recalculate(*F); + DT.recalculate(*const_cast<Function *>(F)); // Generate LoopInfo from it. LoopInfo LI; @@ -146,7 +146,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(DiagnosticInfoOptimizationBase::Argument) void OptimizationRemarkEmitter::computeHotness( DiagnosticInfoIROptimization &OptDiag) { - Value *V = OptDiag.getCodeRegion(); + const Value *V = OptDiag.getCodeRegion(); if (V) OptDiag.setHotness(computeHotness(V)); } |