[llvm] 3e9e43b - Fix compiler error: init-statements in if/switch.
Johannes Reifferscheid via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 02:36:50 PDT 2022
Author: Johannes Reifferscheid
Date: 2022-08-03T11:36:41+02:00
New Revision: 3e9e43b48eb7a6a9b317e4c32ba0ee672630842b
URL: https://github.com/llvm/llvm-project/commit/3e9e43b48eb7a6a9b317e4c32ba0ee672630842b
DIFF: https://github.com/llvm/llvm-project/commit/3e9e43b48eb7a6a9b317e4c32ba0ee672630842b.diff
LOG: Fix compiler error: init-statements in if/switch.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D131061
Added:
Modified:
llvm/lib/Analysis/ScalarEvolution.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index f5f5e676e1be..a3965d073cb4 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -7315,8 +7315,8 @@ ScalarEvolution::getOperandsToCreate(Value *V, SmallVectorImpl<Value *> &Ops) {
// CreateSCEV calls getNoWrapFlagsFromUB, which under certain conditions
// requires a SCEV for the LHS.
if (NewBO->Op && (NewBO->IsNSW || NewBO->IsNUW)) {
- if (auto *I = dyn_cast<Instruction>(NewBO->Op);
- I && programUndefinedIfPoison(I)) {
+ auto *I = dyn_cast<Instruction>(NewBO->Op);
+ if (I && programUndefinedIfPoison(I)) {
Ops.push_back(BO->LHS);
break;
}
More information about the llvm-commits
mailing list