mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-19 01:13:25 +00:00
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:
parent
cb8346563b
commit
09c033962b
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user