aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-07 19:42:14 +0000
committerChris Lattner <sabre@nondot.org>2003-08-07 19:42:14 +0000
commitab05e2aa4cfd1ba326ce218f22448e1173889700 (patch)
treec4ce248753225ad701738d62bd090388eb5a00ad /utils
parenta40e5ad69f5ab5da1671a5e84e75a60202ad03d5 (diff)
downloadexternal_llvm-ab05e2aa4cfd1ba326ce218f22448e1173889700.zip
external_llvm-ab05e2aa4cfd1ba326ce218f22448e1173889700.tar.gz
external_llvm-ab05e2aa4cfd1ba326ce218f22448e1173889700.tar.bz2
Use the new version of isSubClassOf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/InstrSelectorEmitter.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/utils/TableGen/InstrSelectorEmitter.cpp b/utils/TableGen/InstrSelectorEmitter.cpp
index 5aadfa4..b9f0d6e 100644
--- a/utils/TableGen/InstrSelectorEmitter.cpp
+++ b/utils/TableGen/InstrSelectorEmitter.cpp
@@ -110,18 +110,17 @@ void Pattern::error(const std::string &Msg) {
static MVT::ValueType getIntrinsicType(Record *R) {
// Check to see if this is a register or a register class...
- const std::vector<Record*> &SuperClasses = R->getSuperClasses();
- for (unsigned i = 0, e = SuperClasses.size(); i != e; ++i)
- if (SuperClasses[i]->getName() == "RegisterClass") {
- return getValueType(R->getValueAsDef("RegType"));
- } else if (SuperClasses[i]->getName() == "Register") {
- std::cerr << "WARNING: Explicit registers not handled yet!\n";
- return MVT::Other;
- } else if (SuperClasses[i]->getName() == "Nonterminal") {
- //std::cerr << "Warning nonterminal type not handled yet:" << R->getName()
- // << "\n";
- return MVT::Other;
- }
+ if (R->isSubClassOf("RegisterClass")) {
+ return getValueType(R->getValueAsDef("RegType"));
+ } else if (R->isSubClassOf("Register")) {
+ std::cerr << "WARNING: Explicit registers not handled yet!\n";
+ return MVT::Other;
+ } else if (R->isSubClassOf("Nonterminal")) {
+ //std::cerr << "Warning nonterminal type not handled yet:" << R->getName()
+ // << "\n";
+ return MVT::Other;
+ }
+
throw "Error: Unknown value used: " + R->getName();
}