summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorVivek Pandya <vivekvpandya@gmail.com>2017-10-11 17:12:59 +0000
committerVivek Pandya <vivekvpandya@gmail.com>2017-10-11 17:12:59 +0000
commit9590658fb88d40b88ad5bb34c66c946513579384 (patch)
tree7153e7514adc5b98d16cc7a026988c9644b7fa47 /llvm/lib/Analysis
parent87867988f9a57bae14a1d14865cca926205685ba (diff)
downloadbcm5719-llvm-9590658fb88d40b88ad5bb34c66c946513579384.tar.gz
bcm5719-llvm-9590658fb88d40b88ad5bb34c66c946513579384.zip
[NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure
parameterized emit() calls Summary: This is not functional change to adopt new emit() API added in r313691. Reviewed By: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38285 llvm-svn: 315476
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp23
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp16
2 files changed, 22 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index db89fc2181a..b7fe884cc22 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1440,10 +1440,12 @@ bool CallAnalyzer::analyzeBlock(BasicBlock *BB,
if (IsRecursiveCall || ExposesReturnsTwice || HasDynamicAlloca ||
HasIndirectBr || HasFrameEscape) {
if (ORE)
- ORE->emit(OptimizationRemarkMissed(DEBUG_TYPE, "NeverInline",
- CandidateCS.getInstruction())
- << NV("Callee", &F)
- << " has uninlinable pattern and cost is not fully computed");
+ ORE->emit([&]() {
+ return OptimizationRemarkMissed(DEBUG_TYPE, "NeverInline",
+ CandidateCS.getInstruction())
+ << NV("Callee", &F)
+ << " has uninlinable pattern and cost is not fully computed";
+ });
return false;
}
@@ -1453,12 +1455,13 @@ bool CallAnalyzer::analyzeBlock(BasicBlock *BB,
if (IsCallerRecursive &&
AllocatedSize > InlineConstants::TotalAllocaSizeRecursiveCaller) {
if (ORE)
- ORE->emit(
- OptimizationRemarkMissed(DEBUG_TYPE, "NeverInline",
- CandidateCS.getInstruction())
- << NV("Callee", &F)
- << " is recursive and allocates too much stack space. Cost is "
- "not fully computed");
+ ORE->emit([&]() {
+ return OptimizationRemarkMissed(DEBUG_TYPE, "NeverInline",
+ CandidateCS.getInstruction())
+ << NV("Callee", &F)
+ << " is recursive and allocates too much stack space. Cost is "
+ "not fully computed";
+ });
return false;
}
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 2fb43feb751..e505b1cc5a1 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -777,13 +777,15 @@ static void computeKnownBitsFromAssume(const Value *V, KnownBits &Known,
if (Known.Zero.intersects(Known.One)) {
Known.resetAll();
- if (Q.ORE) {
- auto *CxtI = const_cast<Instruction *>(Q.CxtI);
- OptimizationRemarkAnalysis ORA("value-tracking", "BadAssumption", CxtI);
- Q.ORE->emit(ORA << "Detected conflicting code assumptions. Program may "
- "have undefined behavior, or compiler may have "
- "internal error.");
- }
+ if (Q.ORE)
+ Q.ORE->emit([&]() {
+ auto *CxtI = const_cast<Instruction *>(Q.CxtI);
+ return OptimizationRemarkAnalysis("value-tracking", "BadAssumption",
+ CxtI)
+ << "Detected conflicting code assumptions. Program may "
+ "have undefined behavior, or compiler may have "
+ "internal error.";
+ });
}
}
OpenPOWER on IntegriCloud