add some accessor methods.

llvm-svn: 38840
This commit is contained in:
Chris Lattner 2006-08-07 05:50:47 +00:00
parent bf320c84a5
commit 2534b877b4
2 changed files with 18 additions and 1 deletions

View File

@ -261,6 +261,13 @@ public:
: 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 @@ public:
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 {

View File

@ -154,7 +154,7 @@ private:
// C99 6.9: External Definitions.
void ParseExternalDeclaration();
void ParseDeclarationOrFunctionDefinition();
void ParseFunctionDefinition(Declarator &D);
//===--------------------------------------------------------------------===//
// C99 6.7: Declarations.