summaryrefslogtreecommitdiff
path: root/utils/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 /utils/TableGen/CodeEmitterGen.cpp
parent7296fb04211123339473494d28807661b4fef9ff (diff)
downloadllvm-ab47ae3381aa2372009a9054260461c20324b555.tar.gz
llvm-ab47ae3381aa2372009a9054260461c20324b555.tar.bz2
llvm-ab47ae3381aa2372009a9054260461c20324b555.tar.xz
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 'utils/TableGen/CodeEmitterGen.cpp')
-rw-r--r--utils/TableGen/CodeEmitterGen.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp
index 87f3b87dbd..75303c4f60 100644
--- a/utils/TableGen/CodeEmitterGen.cpp
+++ b/utils/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::";