]> granicus.if.org Git - llvm/commitdiff
Fix -Wunused-variable for Release build.
authorRui Ueyama <ruiu@google.com>
Wed, 27 Sep 2017 22:03:15 +0000 (22:03 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 27 Sep 2017 22:03:15 +0000 (22:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314353 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnrollPass.cpp

index 5d828366da29365aa130dd7c7708cc53d0cdd6bf..115d9983b4322dc2867fbe7c89d3044d3451b4a4 100644 (file)
@@ -1298,7 +1298,6 @@ PreservedAnalyses LoopUnrollPass::run(Function &F,
     // for unrolling is only needed to get optimization remarks emitted in
     // a forward order.
     Loop &L = *Worklist.pop_back_val();
-    Loop *ParentL = L.getParentLoop();
 
     // The API here is quite complex to call, but there are only two interesting
     // states we support: partial and full (or "simple") unrolling. However, to
@@ -1320,6 +1319,7 @@ PreservedAnalyses LoopUnrollPass::run(Function &F,
 
     // The parent must not be damaged by unrolling!
 #ifndef NDEBUG
+    Loop *ParentL = L.getParentLoop();
     if (Result != LoopUnrollResult::Unmodified && ParentL)
       ParentL->verifyLoop();
 #endif