diff options
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 10 | ||||
| -rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 1 | ||||
| -rw-r--r-- | utils/TableGen/DAGISelMatcherGen.cpp | 13 | ||||
| -rw-r--r-- | utils/TableGen/DAGISelMatcherOpt.cpp | 2 | 
4 files changed, 14 insertions, 12 deletions
| diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index db90031..ce737bf 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1407,7 +1407,6 @@ void TreePattern::dump() const { print(errs()); }  // CodeGenDAGPatterns implementation  // -// FIXME: REMOVE OSTREAM ARGUMENT  CodeGenDAGPatterns::CodeGenDAGPatterns(RecordKeeper &R) : Records(R) {    Intrinsics = LoadIntrinsics(Records, false);    TgtIntrinsics = LoadIntrinsics(Records, true); @@ -2144,6 +2143,15 @@ void CodeGenDAGPatterns::AddPatternToMatch(const TreePattern *Pattern,    if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this))      Pattern->error("Pattern can never match: " + Reason); +  // If the source pattern's root is a complex pattern, that complex pattern +  // must specify the nodes it can potentially match. +  if (const ComplexPattern *CP = +        PTM.getSrcPattern()->getComplexPatternInfo(*this)) +    if (CP->getRootNodes().empty()) +      Pattern->error("ComplexPattern at root must specify list of opcodes it" +                     " could match"); +   +      // Find all of the named values in the input and output, ensure they have the    // same type.    std::map<std::string, NameRecord> SrcNames, DstNames; diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 03a12cd..e9cfef8 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -233,7 +233,6 @@ void DAGISelEmitter::run(raw_ostream &OS) {      }    } -      Matcher *TheMatcher = new ScopeMatcher(&PatternMatchers[0],                                           PatternMatchers.size()); diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index cc3c4f1..0c7456e 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -505,16 +505,11 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {    // check.    if (const ComplexPattern *CP =                     Pattern.getSrcPattern()->getComplexPatternInfo(CGP)) { -          const std::vector<Record*> &OpNodes = CP->getRootNodes(); -    if (OpNodes.empty()) { -      // FIXME: Empty OpNodes runs on everything, is this even valid? -      if (Variant != 0) return true; -    } else { -      if (Variant >= OpNodes.size()) return true; -       -      AddMatcher(new CheckOpcodeMatcher(CGP.getSDNodeInfo(OpNodes[Variant]))); -    } +    assert(!OpNodes.empty() &&"Complex Pattern must specify what it can match"); +    if (Variant >= OpNodes.size()) return true; +     +    AddMatcher(new CheckOpcodeMatcher(CGP.getSDNodeInfo(OpNodes[Variant])));    } else {      if (Variant != 0) return true;    } diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index ce97fb4..a625fa8 100644 --- a/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/utils/TableGen/DAGISelMatcherOpt.cpp @@ -140,7 +140,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr,          return;        } -      // FIXME2: Kill off all the SelectionDAG::MorphNodeTo and getMachineNode +      // FIXME2: Kill off all the SelectionDAG::SelectNodeTo and getMachineNode        // variants.      } | 
