Fix compiler error: init-statements in if/switch.
authorJohannes Reifferscheid <jreiffers@google.com>
Wed, 3 Aug 2022 09:34:51 +0000 (11:34 +0200)
committerJohannes Reifferscheid <jreiffers@google.com>
Wed, 3 Aug 2022 09:36:41 +0000 (11:36 +0200)
Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D131061

llvm/lib/Analysis/ScalarEvolution.cpp

index f5f5e67..a3965d0 100644 (file)
@@ -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;
           }