summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp16
1 files changed, 9 insertions, 7 deletions
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