Add support for a bool argty

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7766 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-08-12 04:12:42 +00:00
parent 9d27514a21
commit 723915b13e
4 changed files with 16 additions and 4 deletions

View File

@ -19,6 +19,7 @@ NodeType::ArgResultTypes NodeType::Translate(Record *R) {
if (Name == "DNVT_arg0") return Arg0;
if (Name == "DNVT_arg1") return Arg1;
if (Name == "DNVT_ptr" ) return Ptr;
if (Name == "DNVT_bool") return Bool;
throw "Unknown DagNodeValType '" + Name + "'!";
}
@ -275,6 +276,9 @@ bool Pattern::InferTypes(TreePatternNode *N, bool &MadeChange) {
AnyUnset |= InferTypes(Child, MadeChange);
switch (NT.ArgTypes[i]) {
case NodeType::Bool:
MadeChange |= Child->updateNodeType(MVT::i1, TheRecord->getName());
break;
case NodeType::Arg0:
MadeChange |= Child->updateNodeType(N->getChild(0)->getType(),
TheRecord->getName());
@ -300,6 +304,9 @@ bool Pattern::InferTypes(TreePatternNode *N, bool &MadeChange) {
case NodeType::Void:
MadeChange |= N->updateNodeType(MVT::isVoid, TheRecord->getName());
break;
case NodeType::Bool:
MadeChange |= N->updateNodeType(MVT::i1, TheRecord->getName());
break;
case NodeType::Arg0:
MadeChange |= N->updateNodeType(N->getChild(0)->getType(),
TheRecord->getName());

View File

@ -25,8 +25,7 @@ struct NodeType {
Arg0, // Value matches the type of Arg0
Arg1, // Value matches the type of Arg1
Ptr, // Tree node is the type of the target pointer
// Return types
Bool, // Always bool
Void, // Tree node always returns void
};

View File

@ -19,6 +19,7 @@ NodeType::ArgResultTypes NodeType::Translate(Record *R) {
if (Name == "DNVT_arg0") return Arg0;
if (Name == "DNVT_arg1") return Arg1;
if (Name == "DNVT_ptr" ) return Ptr;
if (Name == "DNVT_bool") return Bool;
throw "Unknown DagNodeValType '" + Name + "'!";
}
@ -275,6 +276,9 @@ bool Pattern::InferTypes(TreePatternNode *N, bool &MadeChange) {
AnyUnset |= InferTypes(Child, MadeChange);
switch (NT.ArgTypes[i]) {
case NodeType::Bool:
MadeChange |= Child->updateNodeType(MVT::i1, TheRecord->getName());
break;
case NodeType::Arg0:
MadeChange |= Child->updateNodeType(N->getChild(0)->getType(),
TheRecord->getName());
@ -300,6 +304,9 @@ bool Pattern::InferTypes(TreePatternNode *N, bool &MadeChange) {
case NodeType::Void:
MadeChange |= N->updateNodeType(MVT::isVoid, TheRecord->getName());
break;
case NodeType::Bool:
MadeChange |= N->updateNodeType(MVT::i1, TheRecord->getName());
break;
case NodeType::Arg0:
MadeChange |= N->updateNodeType(N->getChild(0)->getType(),
TheRecord->getName());

View File

@ -25,8 +25,7 @@ struct NodeType {
Arg0, // Value matches the type of Arg0
Arg1, // Value matches the type of Arg1
Ptr, // Tree node is the type of the target pointer
// Return types
Bool, // Always bool
Void, // Tree node always returns void
};