Skip to content

Commit

Permalink
Inline this into its only caller.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171938 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chisophugis committed Jan 9, 2013
1 parent 9d4a661 commit 7be9021
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
16 changes: 5 additions & 11 deletions lib/TableGen/TGParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion lib/TableGen/TGParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class TGParser {
Init *ParseObjectName(MultiClass *CurMultiClass);
Record *ParseClassID();
MultiClass *ParseMultiClassID();
Record *ParseDefmID();
};

} // end namespace llvm
Expand Down

0 comments on commit 7be9021

Please sign in to comment.