From 40687014ea6ce91e1e8a733490d80736506ce51f Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 26 Sep 2017 12:59:01 +0000 Subject: [PATCH] Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI. llvm-svn: 314202 --- llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 6321c96..9e98da1 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -920,10 +920,8 @@ static unsigned getPatternSize(const TreePatternNode *P, if (P->isLeaf() && isa(P->getLeafValue())) Size += 2; - const ComplexPattern *AM = P->getComplexPatternInfo(CGP); - if (AM) { + if (const ComplexPattern *AM = P->getComplexPatternInfo(CGP)) { Size += AM->getComplexity(); - // We don't want to count any children twice, so return early. return Size; } -- 2.7.4