aboutsummaryrefslogtreecommitdiff
path: root/lib/TableGen
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
commit7be9021754559956f7a079d6063b58a36e5bf2fb (patch)
tree005dbc68eab5d8a72a09dca66bdb3ec2b6344494 /lib/TableGen
parent9d4a6610765c3466642397299271ae904d0d73f9 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-rw-r--r--lib/TableGen/TGParser.cpp16
-rw-r--r--lib/TableGen/TGParser.h1
2 files changed, 5 insertions, 12 deletions
diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp
index b106700942..b6c8092395 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 0ea962b995..70fc9df468 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