Change from llvm::SmallSet<std::string> to llvm::StringMap<char>.
[oota-llvm.git] / utils / TableGen / CodeGenTarget.cpp
index e41f75a68ab2a1fa217a4decb98e8d273567253a..78d39ee06fcb15eb5b875226c7f6e28cb1a54f11 100644 (file)
@@ -309,6 +309,11 @@ getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
     throw "Could not find 'IMPLICIT_DEF' instruction!";
   const CodeGenInstruction *IMPLICIT_DEF = &I->second;
   
+  I = getInstructions().find("SUBREG_TO_REG");
+  if (I == Instructions.end())
+    throw "Could not find 'SUBREG_TO_REG' instruction!";
+  const CodeGenInstruction *SUBREG_TO_REG = &I->second;
+  
   // Print out the rest of the instructions now.
   NumberedInstructions.push_back(PHI);
   NumberedInstructions.push_back(INLINEASM);
@@ -317,6 +322,7 @@ getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
   NumberedInstructions.push_back(EXTRACT_SUBREG);
   NumberedInstructions.push_back(INSERT_SUBREG);
   NumberedInstructions.push_back(IMPLICIT_DEF);
+  NumberedInstructions.push_back(SUBREG_TO_REG);
   for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
     if (&II->second != PHI &&
         &II->second != INLINEASM &&
@@ -324,7 +330,8 @@ getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
         &II->second != DECLARE &&
         &II->second != EXTRACT_SUBREG &&
         &II->second != INSERT_SUBREG &&
-        &II->second != IMPLICIT_DEF)
+        &II->second != IMPLICIT_DEF &&
+        &II->second != SUBREG_TO_REG)
       NumberedInstructions.push_back(&II->second);
 }
 
@@ -387,20 +394,12 @@ std::vector<CodeGenIntrinsic> llvm::LoadIntrinsics(const RecordKeeper &RC) {
   
   std::vector<CodeGenIntrinsic> Result;
 
-  // If we are in the context of a target .td file, get the target info so that
-  // we can decode the current intptr_t.
-  CodeGenTarget *CGT = 0;
-  if (Records.getClass("Target") &&
-      Records.getAllDerivedDefinitions("Target").size() == 1)
-    CGT = new CodeGenTarget();
-  
   for (unsigned i = 0, e = I.size(); i != e; ++i)
-    Result.push_back(CodeGenIntrinsic(I[i], CGT));
-  delete CGT;
+    Result.push_back(CodeGenIntrinsic(I[i]));
   return Result;
 }
 
-CodeGenIntrinsic::CodeGenIntrinsic(Record *R, CodeGenTarget *CGT) {
+CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
   TheDef = R;
   std::string DefName = R->getName();
   ModRef = WriteMem;