aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-09-26 12:59:01 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-09-26 12:59:01 +0000
commit40687014ea6ce91e1e8a733490d80736506ce51f (patch)
tree310d2124da0ee4070db97df98b72f8b1f38e2d29 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parente7d4cd639bcd21aebd0d5f9866d9e9ca717297b1 (diff)
downloadllvm-40687014ea6ce91e1e8a733490d80736506ce51f.zip
llvm-40687014ea6ce91e1e8a733490d80736506ce51f.tar.gz
llvm-40687014ea6ce91e1e8a733490d80736506ce51f.tar.bz2
Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.
llvm-svn: 314202
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp4
1 files changed, 1 insertions, 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<IntInit>(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;
}