Validate that the input to 'Pat' patterns is sane.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-11-17 17:43:52 +00:00
parent cb8346563b
commit 09c033962b

View File

@ -1212,6 +1212,14 @@ void DAGISelEmitter::ParsePatterns() {
// never do anything with this pattern: report it to the user.
if (!Pattern->InferAllTypes())
Pattern->error("Could not infer all types in pattern!");
// Validate that the input pattern is correct.
{
std::map<std::string, TreePatternNode*> InstInputs;
std::map<std::string, Record*> InstResults;
FindPatternInputsAndOutputs(Pattern, Pattern->getOnlyTree(),
InstInputs, InstResults);
}
ListInit *LI = Patterns[i]->getValueAsListInit("ResultInstrs");
if (LI->getSize() == 0) continue; // no pattern.