X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FDAGISelMatcherGen.cpp;h=9663b71d6620da06b69e4bfd3e03f81a7c7188d5;hb=47f0e3f434e2e43f951c3a826c40906cb15b7285;hp=4a73b003598afd6da78047c1480c17e96d16898e;hpb=2220408e1a357b127aa915bff67ba7350cafd5c0;p=oota-llvm.git diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 4a73b003598..9663b71d662 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -27,10 +27,8 @@ static MVT::SimpleValueType getRegisterValueType(Record *R, bool FoundRC = false; MVT::SimpleValueType VT = MVT::Other; const CodeGenRegister *Reg = T.getRegBank().getReg(R); - ArrayRef RCs = T.getRegBank().getRegClasses(); - for (unsigned rc = 0, e = RCs.size(); rc != e; ++rc) { - const CodeGenRegisterClass &RC = *RCs[rc]; + for (const auto &RC : T.getRegBank().getRegClasses()) { if (!RC.contains(Reg)) continue; @@ -222,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(N->getLeafValue())) { assert(N->hasName() && "Unnamed ? leaf"); return; } @@ -270,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