+ // Emit function declaration
+ o << "unsigned " << Target.getName() << "CodeEmitter::"
+ << "getBinaryCodeForInstr(const MachineInstr &MI) {\n";
+
+ // Emit instruction base values
+ o << " static const unsigned InstBits[] = {\n";
+ for (std::vector<const CodeGenInstruction*>::iterator
+ IN = NumberedInstructions.begin(),
+ EN = NumberedInstructions.end();
+ IN != EN; ++IN) {
+ const CodeGenInstruction *CGI = *IN;
+ Record *R = CGI->TheDef;
+
+ if (R->getName() == "PHI" ||
+ R->getName() == "INLINEASM" ||
+ R->getName() == "DBG_LABEL" ||
+ R->getName() == "EH_LABEL" ||
+ R->getName() == "GC_LABEL" ||
+ R->getName() == "DECLARE" ||
+ R->getName() == "EXTRACT_SUBREG" ||
+ R->getName() == "INSERT_SUBREG" ||
+ R->getName() == "IMPLICIT_DEF" ||
+ R->getName() == "SUBREG_TO_REG") {
+ o << " 0U,\n";
+ continue;
+ }
+
+ BitsInit *BI = R->getValueAsBitsInit("Inst");