From 0657b40b3cdc6d2bd6c8e67386d59838f18965cc Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Wed, 9 Jan 2013 02:17:14 +0000 Subject: Inline this into its only caller. It's clearer and additionally this gets rid of the usage of `DefmID`, which doesn't really correspond to anything in the language (it was just used in the name of this parsing function which parsed a `MultiClassID` and returned that multiclass's record). This area of the code still needs a lot of work. llvm-svn: 171938 --- llvm/lib/TableGen/TGParser.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'llvm/lib/TableGen/TGParser.cpp') diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index b1067009426..b6c80923952 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/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. -- cgit v1.2.3