1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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

llvm-svn: 24393
This commit is contained in:
Chris Lattner 2005-11-17 17:43:52 +00:00
parent 789cdc4b29
commit 6b83dcf750

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.