diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-05 16:28:08 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-05 16:28:08 +0000 |
commit | 914701ed49f31323176a784b49df05a0d177d1ad (patch) | |
tree | 50084d57103bbaaa4ba230ffe8e76039e3e224cd /include/clang | |
parent | 894bbab6314e85b5bdc5b03b97d8561fbe8545a7 (diff) |
Move AsmLabel into Declarator instead of just a parameter to
ActOnDeclarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Parse/Action.h | 12 | ||||
-rw-r--r-- | include/clang/Parse/DeclSpec.h | 14 |
2 files changed, 14 insertions, 12 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 4f7937a36c..2b6f713441 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -105,12 +105,7 @@ public: /// LastInGroup is non-null for cases where one declspec has multiple /// declarators on it. For example in 'int A, B', ActOnDeclarator will be /// called with LastInGroup=A when invoked for B. - /// - /// AsmLabel is non-null only for top-level function declarations - /// which use the GCC asm-label extension (the expression must be a - /// constant string). - virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup, - ExprTy *AsmLabel) { + virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D,DeclTy *LastInGroup) { return 0; } @@ -144,7 +139,7 @@ public: virtual DeclTy *ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { // Default to ActOnDeclarator. return ActOnStartOfFunctionDef(FnBodyScope, - ActOnDeclarator(FnBodyScope, D, 0, 0)); + ActOnDeclarator(FnBodyScope, D, 0)); } /// ActOnStartOfFunctionDef - This is called at the start of a function @@ -839,8 +834,7 @@ public: /// ActOnDeclarator - If this is a typedef declarator, we modify the /// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is /// popped. - virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup, - ExprTy *AsmLabel); + virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup); /// ActOnPopScope - When a scope is popped, if any typedefs are now /// out-of-scope, they are removed from the IdentifierInfo::FETokenInfo field. diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index 68509145b9..979f0204c5 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -580,11 +580,16 @@ private: // InvalidType - Set by Sema::GetTypeForDeclarator(). bool InvalidType; - // attributes. + /// AttrList - Attributes. AttributeList *AttrList; + + /// AsmLabel - The asm label, if specified. + Action::ExprTy *AsmLabel; + public: Declarator(DeclSpec &ds, TheContext C) - : DS(ds), Identifier(0), Context(C), InvalidType(false), AttrList(0) { + : DS(ds), Identifier(0), Context(C), InvalidType(false), AttrList(0), + AsmLabel(0) { } ~Declarator() { @@ -694,7 +699,10 @@ public: } const AttributeList *getAttributes() const { return AttrList; } AttributeList *getAttributes() { return AttrList; } - + + void setAsmLabel(Action::ExprTy *E) { AsmLabel = E; } + Action::ExprTy *getAsmLabel() const { return AsmLabel; } + void setInvalidType(bool flag) { InvalidType = flag; } bool getInvalidType() const { return InvalidType; } }; |