mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
validate that input sdnodes don't exist in an output pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c217305f76
commit
b775b1e20b
@ -1490,11 +1490,7 @@ TreePatternNode *TreePattern::ParseTreePattern(Init *TheInit, StringRef OpName){
|
||||
Init *II = BI->convertInitializerTo(new IntRecTy());
|
||||
if (II == 0 || !dynamic_cast<IntInit*>(II))
|
||||
error("Bits value must be constants!");
|
||||
|
||||
if (!OpName.empty())
|
||||
error("Constant int argument should not have a name!");
|
||||
|
||||
return new TreePatternNode(dynamic_cast<IntInit*>(II), 1);
|
||||
return ParseTreePattern(II, OpName);
|
||||
}
|
||||
|
||||
DagInit *Dag = dynamic_cast<DagInit*>(TheInit);
|
||||
@ -1534,9 +1530,28 @@ TreePatternNode *TreePattern::ParseTreePattern(Init *TheInit, StringRef OpName){
|
||||
error("Unrecognized node '" + Operator->getName() + "'!");
|
||||
|
||||
// Check to see if this is something that is illegal in an input pattern.
|
||||
if (isInputPattern && (Operator->isSubClassOf("Instruction") ||
|
||||
Operator->isSubClassOf("SDNodeXForm")))
|
||||
error("Cannot use '" + Operator->getName() + "' in an input pattern!");
|
||||
if (isInputPattern) {
|
||||
if (Operator->isSubClassOf("Instruction") ||
|
||||
Operator->isSubClassOf("SDNodeXForm"))
|
||||
error("Cannot use '" + Operator->getName() + "' in an input pattern!");
|
||||
} else {
|
||||
if (Operator->isSubClassOf("Intrinsic"))
|
||||
error("Cannot use '" + Operator->getName() + "' in an output pattern!");
|
||||
|
||||
if (Operator->isSubClassOf("SDNode") &&
|
||||
Operator->getName() != "imm" &&
|
||||
Operator->getName() != "fpimm" &&
|
||||
Operator->getName() != "tglobaltlsaddr" &&
|
||||
Operator->getName() != "tconstpool" &&
|
||||
Operator->getName() != "tjumptable" &&
|
||||
Operator->getName() != "tframeindex" &&
|
||||
Operator->getName() != "texternalsym" &&
|
||||
Operator->getName() != "tblockaddress" &&
|
||||
Operator->getName() != "tglobaladdr" &&
|
||||
Operator->getName() != "bb" &&
|
||||
Operator->getName() != "vt")
|
||||
error("Cannot use '" + Operator->getName() + "' in an output pattern!");
|
||||
}
|
||||
|
||||
std::vector<TreePatternNode*> Children;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user