diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-17 17:43:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-17 17:43:52 +0000 |
commit | 09c033962bf26b2b35f18a2ead2d86748a030cef (patch) | |
tree | 4fb66f862e3a1c39538e146e86ada4f5b3e11f29 | |
parent | cb8346563b0389522ce668567d2c3e1ffa6ec9d0 (diff) |
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
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index bdae7615f9..68248d7d66 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -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. |