diff options
author | Andrew Trick <atrick@apple.com> | 2012-10-03 23:06:32 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-10-03 23:06:32 +0000 |
commit | 13745262a8db98d6c4513ff9934db4be75a8b26c (patch) | |
tree | 94a2e5f6ae75723c8ef8895bbd96fc264d52821d /utils/TableGen/SetTheory.cpp | |
parent | 2062b1260fa9df3e69e7b4d24a657a0ebb7f8710 (diff) |
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")>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/SetTheory.cpp')
-rw-r--r-- | utils/TableGen/SetTheory.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/TableGen/SetTheory.cpp b/utils/TableGen/SetTheory.cpp index 46e6db173e..bdca9a63bd 100644 --- a/utils/TableGen/SetTheory.cpp +++ b/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<Record*> &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<const StringInit *>(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); } |