Move the MMX subtarget feature out of the SSE set of features and into
[oota-llvm.git] / utils / TableGen / DAGISelMatcherGen.cpp
index 47d3b64715684f50f89bb340798111efac672944..9663b71d6620da06b69e4bfd3e03f81a7c7188d5 100644 (file)
@@ -28,18 +28,18 @@ static MVT::SimpleValueType getRegisterValueType(Record *R,
   MVT::SimpleValueType VT = MVT::Other;
   const CodeGenRegister *Reg = T.getRegBank().getReg(R);
 
-  for (const auto *RC : T.getRegBank().getRegClasses()) {
-    if (!RC->contains(Reg))
+  for (const auto &RC : T.getRegBank().getRegClasses()) {
+    if (!RC.contains(Reg))
       continue;
 
     if (!FoundRC) {
       FoundRC = true;
-      VT = RC->getValueTypeNum(0);
+      VT = RC.getValueTypeNum(0);
       continue;
     }
 
     // If this occurs in multiple register classes, they all have to agree.
-    assert(VT == RC->getValueTypeNum(0));
+    assert(VT == RC.getValueTypeNum(0));
   }
   return VT;
 }
@@ -220,7 +220,7 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
   }
 
   // An UnsetInit represents a named node without any constraints.
-  if (N->getLeafValue() == UnsetInit::get()) {
+  if (isa<UnsetInit>(N->getLeafValue())) {
     assert(N->hasName() && "Unnamed ? leaf");
     return;
   }
@@ -268,8 +268,10 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
     // We can't model ComplexPattern uses that don't have their name taken yet.
     // The OPC_CheckComplexPattern operation implicitly records the results.
     if (N->getName().empty()) {
-      errs() << "We expect complex pattern uses to have names: " << *N << "\n";
-      exit(1);
+      std::string S;
+      raw_string_ostream OS(S);
+      OS << "We expect complex pattern uses to have names: " << *N;
+      PrintFatalError(OS.str());
     }
 
     // Remember this ComplexPattern so that we can emit it after all the other