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 | 9e1deb69b9defa45679f24518a028c66fc8c9577 (patch) | |
tree | 3b76b96a4d10edc7675a9b2d0a60b7c08802245c /llvm/utils/TableGen/SetTheory.cpp | |
parent | da984b1aa9c40cde1f59f53b96589632e5742727 (diff) | |
download | bcm5719-llvm-9e1deb69b9defa45679f24518a028c66fc8c9577.tar.gz bcm5719-llvm-9e1deb69b9defa45679f24518a028c66fc8c9577.zip |
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
Diffstat (limited to 'llvm/utils/TableGen/SetTheory.cpp')
-rw-r--r-- | llvm/utils/TableGen/SetTheory.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<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); } |