Move variable only used inside an assert into the assert.
authorSterling Augustine <saugustine@google.com>
Thu, 10 Jun 2021 20:12:46 +0000 (13:12 -0700)
committerSterling Augustine <saugustine@google.com>
Thu, 10 Jun 2021 20:14:45 +0000 (13:14 -0700)
This prevents build failures with -Wunused.

clang/lib/Serialization/ASTReaderStmt.cpp

index 62d7a99..b100f94 100644 (file)
@@ -3206,8 +3206,7 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
     }
 
     case STMT_OMP_UNROLL_DIRECTIVE: {
-      unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
-      assert(NumLoops == 1 && "Unroll directive accepts only a single loop");
+      assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
       unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
       S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
       break;