From 9e1deb69b9defa45679f24518a028c66fc8c9577 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Wed, 3 Oct 2012 23:06:32 +0000 Subject: Added instregex support to TableGen subtarget emitter. This allows the processor-specific machine model to override selected base opcodes without any fanciness. e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>. llvm-svn: 165180 --- llvm/utils/TableGen/SetTheory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/utils/TableGen/SetTheory.cpp') diff --git a/llvm/utils/TableGen/SetTheory.cpp b/llvm/utils/TableGen/SetTheory.cpp index 46e6db173ea..bdca9a63bd2 100644 --- a/llvm/utils/TableGen/SetTheory.cpp +++ b/llvm/utils/TableGen/SetTheory.cpp @@ -294,7 +294,10 @@ const RecVec *SetTheory::expand(Record *Set) { // This is the first time we see Set. Find a suitable expander. try { const std::vector &SC = Set->getSuperClasses(); - for (unsigned i = 0, e = SC.size(); i != e; ++i) + for (unsigned i = 0, e = SC.size(); i != e; ++i) { + // Skip unnamed superclasses. + if (!dynamic_cast(SC[i]->getNameInit())) + continue; if (Expander *Exp = Expanders.lookup(SC[i]->getName())) { // This breaks recursive definitions. RecVec &EltVec = Expansions[Set]; @@ -303,6 +306,7 @@ const RecVec *SetTheory::expand(Record *Set) { EltVec.assign(Elts.begin(), Elts.end()); return &EltVec; } + } } catch (const std::string &Error) { throw TGError(Set->getLoc(), Error); } -- cgit v1.2.3