diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-01 22:29:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-01 22:29:19 +0000 |
commit | 1e634e31de0767d7f0d6c76f3c258d415afa0b5b (patch) | |
tree | f217f3f4abb44e47fc3ff5b342592a35b38d57fe /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 7263cf8431d3e42d389db56403ee425d0bcdb66c (diff) | |
download | bcm5719-llvm-1e634e31de0767d7f0d6c76f3c258d415afa0b5b.tar.gz bcm5719-llvm-1e634e31de0767d7f0d6c76f3c258d415afa0b5b.zip |
resolve a fixme by having the .td file parser reject thigns like
(set GPR, somecomplexpattern)
if somecomplexpattern doesn't declare what it can match.
llvm-svn: 97513
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index db90031709c..ce737bf3d34 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/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; |