Author: Sterling Augustine
Date: 2021-02-18T13:04:58-08:00
New Revision: 4544a63b77056212af341722b2e04471a8ec0be6

URL: 
https://github.com/llvm/llvm-project/commit/4544a63b77056212af341722b2e04471a8ec0be6
DIFF: 
https://github.com/llvm/llvm-project/commit/4544a63b77056212af341722b2e04471a8ec0be6.diff

LOG: Move variable only used in an assert into the assert.

This prevents unused variable warnings when building without asserts.

Added: 
    

Modified: 
    clang/lib/CodeGen/CoverageMappingGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CoverageMappingGen.cpp 
b/clang/lib/CodeGen/CoverageMappingGen.cpp
index ce2cb380e0c1..519b9ad4bdbd 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -981,8 +981,8 @@ struct CounterCoverageMappingBuilder
       bool UnnestStart = StartDepth >= EndDepth;
       bool UnnestEnd = EndDepth >= StartDepth;
       if (UnnestEnd) {
-        SourceLocation NestedLoc = getStartOfFileOrMacro(BeforeLoc);
-        assert(SM.isWrittenInSameFile(NestedLoc, BeforeLoc));
+        assert(SM.isWrittenInSameFile(getStartOfFileOrMacro(BeforeLoc),
+                                      BeforeLoc));
 
         BeforeLoc = getIncludeOrExpansionLoc(BeforeLoc);
         assert(BeforeLoc.isValid());


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to