From ab47ae3381aa2372009a9054260461c20324b555 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Aug 2003 04:09:58 +0000 Subject: 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 --- utils/TableGen/CodeEmitterGen.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'utils/TableGen/CodeEmitterGen.cpp') 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 Insts; const std::map &Defs = Records.getDefs(); - Record *Inst = Records.getClass("Instruction"); - assert(Inst && "Couldn't find Instruction class!"); - for (std::map::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::"; -- cgit v1.2.3