summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorSean Silva <silvas@purdue.edu>2013-01-09 02:17:14 +0000
committerSean Silva <silvas@purdue.edu>2013-01-09 02:17:14 +0000
commit0657b40b3cdc6d2bd6c8e67386d59838f18965cc (patch)
treeb1799dd15b44f3ba42799aa8db588593640c1a7c /llvm/lib/TableGen/TGParser.cpp
parent28f3721aa033b941aef293724bce70ff5818d045 (diff)
downloadbcm5719-llvm-0657b40b3cdc6d2bd6c8e67386d59838f18965cc.tar.gz
bcm5719-llvm-0657b40b3cdc6d2bd6c8e67386d59838f18965cc.zip
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
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp16
1 files changed, 5 insertions, 11 deletions
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.
OpenPOWER on IntegriCloud