[cfe-commits] r38840 - in /cfe/cfe/trunk/include/clang/Parse: DeclSpec.h Parser.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:25:05 PDT 2007


Author: sabre
Date: Wed Jul 11 11:25:05 2007
New Revision: 38840

URL: http://llvm.org/viewvc/llvm-project?rev=38840&view=rev
Log:
add some accessor methods.

Modified:
    cfe/cfe/trunk/include/clang/Parse/DeclSpec.h
    cfe/cfe/trunk/include/clang/Parse/Parser.h

Modified: cfe/cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=38840&r1=38839&r2=38840&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/DeclSpec.h Wed Jul 11 11:25:05 2007
@@ -261,6 +261,13 @@
     : DS(ds), Identifier(0), Context(C) {
   }
   
+  /// clear - Reset the contents of this Declarator.
+  void clear() {
+    Identifier = 0;
+    IdentifierLoc = SourceLocation();
+    DeclTypeInfo.clear();
+  }
+  
   /// mayOmitIdentifier - Return true if the identifier is either optional or
   /// not allowed.  This is true for typenames and prototypes.
   bool mayOmitIdentifier() const {
@@ -290,6 +297,16 @@
     DeclTypeInfo.push_back(TI);
   }
   
+  /// getNumTypeObjects() - Return the number of types applied to this
+  /// declarator.
+  unsigned getNumTypeObjects() const { return DeclTypeInfo.size(); }
+  
+  /// Return the specified TypeInfo from this declarator.  TypeInfo #0 is
+  /// closest to the identifier.
+  const DeclaratorTypeInfo &getTypeObject(unsigned i) const {
+    return DeclTypeInfo[i];
+  }
+  
   /// isInnermostFunctionType - Once this declarator is fully parsed and formed,
   /// this method returns true if the identifier is a function declarator.
   bool isInnermostFunctionType() const {

Modified: cfe/cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Parser.h?rev=38840&r1=38839&r2=38840&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Parser.h Wed Jul 11 11:25:05 2007
@@ -154,7 +154,7 @@
   // C99 6.9: External Definitions.
   void ParseExternalDeclaration();
   void ParseDeclarationOrFunctionDefinition();
-
+  void ParseFunctionDefinition(Declarator &D);
   
   //===--------------------------------------------------------------------===//
   // C99 6.7: Declarations.





More information about the cfe-commits mailing list