From 4544a63b77056212af341722b2e04471a8ec0be6 Mon Sep 17 00:00:00 2001 From: Sterling Augustine Date: Thu, 18 Feb 2021 13:00:49 -0800 Subject: [PATCH] Move variable only used in an assert into the assert. This prevents unused variable warnings when building without asserts. --- clang/lib/CodeGen/CoverageMappingGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()); -- 2.34.1