]> granicus.if.org Git - llvm/commitdiff
[TableGen] Make sure to recursively factor any ScopeMatchers created while forming...
authorCraig Topper <craig.topper@gmail.com>
Thu, 5 May 2016 06:19:27 +0000 (06:19 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 5 May 2016 06:19:27 +0000 (06:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268611 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelMatcherOpt.cpp

index 5c5774066b8b3cc24178ba52d3325c053070192d..a0211edce099b5838dfeaddaa1761915ed3f7f8f 100644 (file)
@@ -484,7 +484,9 @@ static void FactorNodes(std::unique_ptr<Matcher> &MatcherPtr) {
         }
         
         Matcher *Entries[2] = { PrevMatcher, MatcherWithoutCTM };
-        Cases[Entry-1].second = new ScopeMatcher(Entries);
+        std::unique_ptr<Matcher> Case(new ScopeMatcher(Entries));
+        FactorNodes(Case);
+        Cases[Entry-1].second = Case.release();
         continue;
       }