[llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp CodeEmitterGen.cpp CodeGenTarget.cpp DAGISelEmitter.cpp InstrInfoEmitter.cpp

Jim Laskey jlaskey at apple.com
Fri Jan 26 09:29:36 PST 2007



Changes in directory llvm/utils/TableGen:

AsmWriterEmitter.cpp updated: 1.47 -> 1.48
CodeEmitterGen.cpp updated: 1.52 -> 1.53
CodeGenTarget.cpp updated: 1.81 -> 1.82
DAGISelEmitter.cpp updated: 1.290 -> 1.291
InstrInfoEmitter.cpp updated: 1.55 -> 1.56
---
Log message:

Files missing from LABEL check in.


---
Diffs of the changes:  (+34 -7)

 AsmWriterEmitter.cpp |    5 ++++-
 CodeEmitterGen.cpp   |   12 +++++++++---
 CodeGenTarget.cpp    |    9 ++++++++-
 DAGISelEmitter.cpp   |   11 ++++++++++-
 InstrInfoEmitter.cpp |    4 +++-
 5 files changed, 34 insertions(+), 7 deletions(-)


Index: llvm/utils/TableGen/AsmWriterEmitter.cpp
diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.47 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.48
--- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.47	Thu Dec  7 16:21:48 2006
+++ llvm/utils/TableGen/AsmWriterEmitter.cpp	Fri Jan 26 11:29:20 2007
@@ -344,7 +344,7 @@
   
   for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
     const AsmWriterInst *Inst = getAsmWriterInstByID(i);
-    if (Inst == 0) continue;  // PHI, INLINEASM, etc.
+    if (Inst == 0) continue;  // PHI, INLINEASM, LABEL, etc.
     
     std::string Command;
     if (Inst->Operands.empty())
@@ -621,6 +621,9 @@
   O << "  if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
     << "    printInlineAsm(MI);\n"
     << "    return true;\n"
+    << "  } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
+    << "    printLabel(MI);\n"
+    << "    return true;\n"
     << "  }\n\n";
   
   O << "  // Emit the opcode for the instruction.\n"


Index: llvm/utils/TableGen/CodeEmitterGen.cpp
diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.52 llvm/utils/TableGen/CodeEmitterGen.cpp:1.53
--- llvm/utils/TableGen/CodeEmitterGen.cpp:1.52	Thu Dec  7 16:21:48 2006
+++ llvm/utils/TableGen/CodeEmitterGen.cpp	Fri Jan 26 11:29:20 2007
@@ -24,7 +24,9 @@
   for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
        I != E; ++I) {
     Record *R = *I;
-    if (R->getName() == "PHI" || R->getName() == "INLINEASM") continue;
+    if (R->getName() == "PHI" ||
+        R->getName() == "INLINEASM" ||
+        R->getName() == "LABEL") continue;
     
     BitsInit *BI = R->getValueAsBitsInit("Inst");
 
@@ -93,7 +95,9 @@
     
     if (IN != NumberedInstructions.begin()) o << ",\n";
     
-    if (R->getName() == "PHI" || R->getName() == "INLINEASM") {
+    if (R->getName() == "PHI" ||
+        R->getName() == "INLINEASM" ||
+        R->getName() == "LABEL") {
       o << "    0U";
       continue;
     }
@@ -121,7 +125,9 @@
     const std::string &InstName = R->getName();
     std::string Case("");
     
-    if (InstName == "PHI" || InstName == "INLINEASM") continue;
+    if (InstName == "PHI" ||
+        InstName == "INLINEASM" ||
+        InstName == "LABEL") continue;
     
     BitsInit *BI = R->getValueAsBitsInit("Inst");
     const std::vector<RecordVal> &Vals = R->getValues();


Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.81 llvm/utils/TableGen/CodeGenTarget.cpp:1.82
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.81	Thu Dec  7 16:21:48 2006
+++ llvm/utils/TableGen/CodeGenTarget.cpp	Fri Jan 26 11:29:20 2007
@@ -258,11 +258,18 @@
   if (I == Instructions.end()) throw "Could not find 'INLINEASM' instruction!";
   const CodeGenInstruction *INLINEASM = &I->second;
   
+  I = getInstructions().find("LABEL");
+  if (I == Instructions.end()) throw "Could not find 'LABEL' instruction!";
+  const CodeGenInstruction *LABEL = &I->second;
+  
   // Print out the rest of the instructions now.
   NumberedInstructions.push_back(PHI);
   NumberedInstructions.push_back(INLINEASM);
+  NumberedInstructions.push_back(LABEL);
   for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
-    if (&II->second != PHI &&&II->second != INLINEASM)
+    if (&II->second != PHI &&
+        &II->second != INLINEASM &&
+        &II->second != LABEL)
       NumberedInstructions.push_back(&II->second);
 }
 


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.290 llvm/utils/TableGen/DAGISelEmitter.cpp:1.291
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.290	Wed Jan 17 01:45:12 2007
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Fri Jan 26 11:29:20 2007
@@ -3688,6 +3688,14 @@
      << "  return New.Val;\n"
      << "}\n\n";
   
+  OS << "SDNode *Select_LABEL(const SDOperand &N) {\n"
+     << "  SDOperand Chain = N.getOperand(0);\n"
+     << "  SDOperand N1 = N.getOperand(1);\n"
+     << "  AddToISelQueue(Chain);\n"
+     << "  return CurDAG->getTargetNode(TargetInstrInfo::LABEL,\n"
+     << "                               MVT::Other, N1, Chain);\n"
+     << "}\n\n";
+
   OS << "// The main instruction selector code.\n"
      << "SDNode *SelectCode(SDOperand N) {\n"
      << "  if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n"
@@ -3722,7 +3730,8 @@
      << "      AddToISelQueue(N.getOperand(i));\n"
      << "    return NULL;\n"
      << "  }\n"
-     << "  case ISD::INLINEASM:  return Select_INLINEASM(N);\n";
+     << "  case ISD::INLINEASM: return Select_INLINEASM(N);\n"
+     << "  case ISD::LABEL: return Select_LABEL(N);\n";
 
     
   // Loop over all of the case statements, emiting a call to each method we


Index: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.55 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.56
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.55	Thu Dec  7 16:21:48 2006
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp	Fri Jan 26 11:29:20 2007
@@ -315,7 +315,9 @@
 
   if (RV == 0 || RV->getValue() == 0) {
     // This isn't an error if this is a builtin instruction.
-    if (R->getName() != "PHI" && R->getName() != "INLINEASM")
+    if (R->getName() != "PHI" &&
+        R->getName() != "INLINEASM" &&
+        R->getName() != "LABEL")
       throw R->getName() + " doesn't have a field named '" + 
             Val->getValue() + "'!";
     return;






More information about the llvm-commits mailing list