diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-12 04:12:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-12 04:12:42 +0000 |
commit | 723915b13e1647fdc02e4e7e3a3335e3e80cfc75 (patch) | |
tree | 5a184e2cabb62048d99ed606529a5659ba8b208f /utils | |
parent | 9d27514a21364e1d1ff307d3998bc4533ade8f87 (diff) | |
download | external_llvm-723915b13e1647fdc02e4e7e3a3335e3e80cfc75.zip external_llvm-723915b13e1647fdc02e4e7e3a3335e3e80cfc75.tar.gz external_llvm-723915b13e1647fdc02e4e7e3a3335e3e80cfc75.tar.bz2 |
Add support for a bool argty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/InstrSelectorEmitter.cpp | 7 | ||||
-rw-r--r-- | utils/TableGen/InstrSelectorEmitter.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/utils/TableGen/InstrSelectorEmitter.cpp b/utils/TableGen/InstrSelectorEmitter.cpp index 42d3c22..133ed7d 100644 --- a/utils/TableGen/InstrSelectorEmitter.cpp +++ b/utils/TableGen/InstrSelectorEmitter.cpp @@ -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()); diff --git a/utils/TableGen/InstrSelectorEmitter.h b/utils/TableGen/InstrSelectorEmitter.h index a8ab145..d34c191 100644 --- a/utils/TableGen/InstrSelectorEmitter.h +++ b/utils/TableGen/InstrSelectorEmitter.h @@ -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 }; |