[llvm-commits] [llvm] r171938 - in /llvm/trunk/lib/TableGen: TGParser.cpp TGParser.h

Sean Silva silvas at purdue.edu
Tue Jan 8 18:17:14 PST 2013


Author: silvas
Date: Tue Jan  8 20:17:14 2013
New Revision: 171938

URL: http://llvm.org/viewvc/llvm-project?rev=171938&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/TableGen/TGParser.cpp
    llvm/trunk/lib/TableGen/TGParser.h

Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=171938&r1=171937&r2=171938&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Tue Jan  8 20:17:14 2013
@@ -455,14 +455,6 @@
   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 @@
   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.

Modified: llvm/trunk/lib/TableGen/TGParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.h?rev=171938&r1=171937&r2=171938&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.h (original)
+++ llvm/trunk/lib/TableGen/TGParser.h Tue Jan  8 20:17:14 2013
@@ -183,7 +183,6 @@
   Init *ParseObjectName(MultiClass *CurMultiClass);
   Record *ParseClassID();
   MultiClass *ParseMultiClassID();
-  Record *ParseDefmID();
 };
 
 } // end namespace llvm





More information about the llvm-commits mailing list