aboutsummaryrefslogtreecommitdiffstats
path: root/support/tools/TableGen/CodeEmitterGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-01 04:09:58 +0000
committerChris Lattner <sabre@nondot.org>2003-08-01 04:09:58 +0000
commitab47ae3381aa2372009a9054260461c20324b555 (patch)
treef5ccadad006085883dcc817623e97b79498d67da /support/tools/TableGen/CodeEmitterGen.cpp
parent7296fb04211123339473494d28807661b4fef9ff (diff)
downloadexternal_llvm-ab47ae3381aa2372009a9054260461c20324b555.zip
external_llvm-ab47ae3381aa2372009a9054260461c20324b555.tar.gz
external_llvm-ab47ae3381aa2372009a9054260461c20324b555.tar.bz2
Factor code out into a new getAllDerivedDefinitions method, which is generally useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'support/tools/TableGen/CodeEmitterGen.cpp')
-rw-r--r--support/tools/TableGen/CodeEmitterGen.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/support/tools/TableGen/CodeEmitterGen.cpp b/support/tools/TableGen/CodeEmitterGen.cpp
index 87f3b87..75303c4 100644
--- a/support/tools/TableGen/CodeEmitterGen.cpp
+++ b/support/tools/TableGen/CodeEmitterGen.cpp
@@ -12,13 +12,8 @@ bool CodeEmitterGen::run(std::ostream &o) {
std::vector<Record*> Insts;
const std::map<std::string, Record*> &Defs = Records.getDefs();
- Record *Inst = Records.getClass("Instruction");
- assert(Inst && "Couldn't find Instruction class!");
- for (std::map<std::string, Record*>::const_iterator I = Defs.begin(),
- E = Defs.end(); I != E; ++I)
- if (I->second->isSubClassOf(Inst))
- Insts.push_back(I->second);
+ Records.getAllDerivedDefinitions("Instruction", Insts);
std::string Namespace = "V9::";
std::string ClassName = "SparcV9CodeEmitter::";