llvm.org GIT mirror llvm / a683f9b
Files missing from LABEL check in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33539 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Laskey 12 years ago
5 changed file(s) with 34 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
343343
344344 for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
345345 const AsmWriterInst *Inst = getAsmWriterInstByID(i);
346 if (Inst == 0) continue; // PHI, INLINEASM, etc.
346 if (Inst == 0) continue; // PHI, INLINEASM, LABEL, etc.
347347
348348 std::string Command;
349349 if (Inst->Operands.empty())
620620 O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
621621 << " printInlineAsm(MI);\n"
622622 << " return true;\n"
623 << " } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
624 << " printLabel(MI);\n"
625 << " return true;\n"
623626 << " }\n\n";
624627
625628 O << " // Emit the opcode for the instruction.\n"
2323 for (std::vector::iterator I = Insts.begin(), E = Insts.end();
2424 I != E; ++I) {
2525 Record *R = *I;
26 if (R->getName() == "PHI" || R->getName() == "INLINEASM") continue;
26 if (R->getName() == "PHI" ||
27 R->getName() == "INLINEASM" ||
28 R->getName() == "LABEL") continue;
2729
2830 BitsInit *BI = R->getValueAsBitsInit("Inst");
2931
9294
9395 if (IN != NumberedInstructions.begin()) o << ",\n";
9496
95 if (R->getName() == "PHI" || R->getName() == "INLINEASM") {
97 if (R->getName() == "PHI" ||
98 R->getName() == "INLINEASM" ||
99 R->getName() == "LABEL") {
96100 o << " 0U";
97101 continue;
98102 }
120124 const std::string &InstName = R->getName();
121125 std::string Case("");
122126
123 if (InstName == "PHI" || InstName == "INLINEASM") continue;
127 if (InstName == "PHI" ||
128 InstName == "INLINEASM" ||
129 InstName == "LABEL") continue;
124130
125131 BitsInit *BI = R->getValueAsBitsInit("Inst");
126132 const std::vector &Vals = R->getValues();
257257 if (I == Instructions.end()) throw "Could not find 'INLINEASM' instruction!";
258258 const CodeGenInstruction *INLINEASM = &I->second;
259259
260 I = getInstructions().find("LABEL");
261 if (I == Instructions.end()) throw "Could not find 'LABEL' instruction!";
262 const CodeGenInstruction *LABEL = &I->second;
263
260264 // Print out the rest of the instructions now.
261265 NumberedInstructions.push_back(PHI);
262266 NumberedInstructions.push_back(INLINEASM);
267 NumberedInstructions.push_back(LABEL);
263268 for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
264 if (&II->second != PHI &&&II->second != INLINEASM)
269 if (&II->second != PHI &&
270 &II->second != INLINEASM &&
271 &II->second != LABEL)
265272 NumberedInstructions.push_back(&II->second);
266273 }
267274
36873687 << " return New.Val;\n"
36883688 << "}\n\n";
36893689
3690 OS << "SDNode *Select_LABEL(const SDOperand &N) {\n"
3691 << " SDOperand Chain = N.getOperand(0);\n"
3692 << " SDOperand N1 = N.getOperand(1);\n"
3693 << " AddToISelQueue(Chain);\n"
3694 << " return CurDAG->getTargetNode(TargetInstrInfo::LABEL,\n"
3695 << " MVT::Other, N1, Chain);\n"
3696 << "}\n\n";
3697
36903698 OS << "// The main instruction selector code.\n"
36913699 << "SDNode *SelectCode(SDOperand N) {\n"
36923700 << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n"
37213729 << " AddToISelQueue(N.getOperand(i));\n"
37223730 << " return NULL;\n"
37233731 << " }\n"
3724 << " case ISD::INLINEASM: return Select_INLINEASM(N);\n";
3732 << " case ISD::INLINEASM: return Select_INLINEASM(N);\n"
3733 << " case ISD::LABEL: return Select_LABEL(N);\n";
37253734
37263735
37273736 // Loop over all of the case statements, emiting a call to each method we
314314
315315 if (RV == 0 || RV->getValue() == 0) {
316316 // This isn't an error if this is a builtin instruction.
317 if (R->getName() != "PHI" && R->getName() != "INLINEASM")
317 if (R->getName() != "PHI" &&
318 R->getName() != "INLINEASM" &&
319 R->getName() != "LABEL")
318320 throw R->getName() + " doesn't have a field named '" +
319321 Val->getValue() + "'!";
320322 return;