Move a second variable only used in an assert into the assert.
authorSterling Augustine <saugustine@google.com>
Thu, 18 Feb 2021 21:25:37 +0000 (13:25 -0800)
committerSterling Augustine <saugustine@google.com>
Thu, 18 Feb 2021 21:26:07 +0000 (13:26 -0800)
This prevents unused variable warnings when building without asserts.

clang/lib/CodeGen/CoverageMappingGen.cpp

index 519b9ad..72ed10d 100644 (file)
@@ -989,8 +989,8 @@ struct CounterCoverageMappingBuilder
         EndDepth--;
       }
       if (UnnestStart) {
-        SourceLocation NestedLoc = getEndOfFileOrMacro(AfterLoc);
-        assert(SM.isWrittenInSameFile(AfterLoc, NestedLoc));
+        assert(SM.isWrittenInSameFile(AfterLoc,
+                                      getEndOfFileOrMacro(AfterLoc)));
 
         AfterLoc = getIncludeOrExpansionLoc(AfterLoc);
         assert(AfterLoc.isValid());