[llvm] e958379 - Fold the opt size check into the assert to silence an unused variable warning.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 16:05:37 PDT 2020


Author: Eric Christopher
Date: 2020-07-13T16:05:24-07:00
New Revision: e958379581e5845572c21b8871873fcb0b15743e

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

LOG: Fold the opt size check into the assert to silence an unused variable warning.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index e91828bd1707..3cd80cb04ab8 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -182,9 +182,8 @@ namespace {
                              "indirect-tls-seg-refs");
 
       // OptFor[Min]Size are used in pattern predicates that isel is matching.
-      bool OptForSize = MF.getFunction().hasOptSize();
       OptForMinSize = MF.getFunction().hasMinSize();
-      assert((!OptForMinSize || OptForSize) &&
+      assert((!OptForMinSize || MF.getFunction().hasOptSize()) &&
              "OptForMinSize implies OptForSize");
 
       SelectionDAGISel::runOnMachineFunction(MF);


        


More information about the llvm-commits mailing list