diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index b1067009426..b6c80923952 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -455,14 +455,6 @@ MultiClass *TGParser::ParseMultiClassID() { return Result; } -Record *TGParser::ParseDefmID() { - MultiClass *MC = ParseMultiClassID(); - if (!MC) - return 0; - return &MC->Rec; -} - - /// ParseSubClassReference - Parse a reference to a subclass or to a templated /// subclass. This returns a SubClassRefTy with a null Record* on error. /// @@ -474,10 +466,12 @@ ParseSubClassReference(Record *CurRec, bool isDefm) { SubClassReference Result; Result.RefLoc = Lex.getLoc(); - if (isDefm) - Result.Rec = ParseDefmID(); - else + if (isDefm) { + if (MultiClass *MC = ParseMultiClassID()) + Result.Rec = &MC->Rec; + } else { Result.Rec = ParseClassID(); + } if (Result.Rec == 0) return Result; // If there is no template arg list, we're done. diff --git a/lib/TableGen/TGParser.h b/lib/TableGen/TGParser.h index 0ea962b9952..70fc9df4683 100644 --- a/lib/TableGen/TGParser.h +++ b/lib/TableGen/TGParser.h @@ -183,7 +183,6 @@ private: // Parser methods. Init *ParseObjectName(MultiClass *CurMultiClass); Record *ParseClassID(); MultiClass *ParseMultiClassID(); - Record *ParseDefmID(); }; } // end namespace llvm