diff options
| -rw-r--r-- | clang/Driver/PrintParserCallbacks.cpp | 4 | ||||
| -rw-r--r-- | clang/include/clang/Parse/Action.h | 12 | ||||
| -rw-r--r-- | clang/include/clang/Parse/DeclSpec.h | 14 | ||||
| -rw-r--r-- | clang/lib/Parse/MinimalAction.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseObjc.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/Sema.h | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 2 | 
9 files changed, 28 insertions, 28 deletions
diff --git a/clang/Driver/PrintParserCallbacks.cpp b/clang/Driver/PrintParserCallbacks.cpp index 2de16144d5c..fec13e39090 100644 --- a/clang/Driver/PrintParserCallbacks.cpp +++ b/clang/Driver/PrintParserCallbacks.cpp @@ -30,7 +30,7 @@ namespace {      /// and 'Init' specifies the initializer if any.  This is for things like:      /// "int X = 4" or "typedef int foo".      virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, -                                    DeclTy *LastInGroup, ExprTy *AsmLabel) { +                                    DeclTy *LastInGroup) {        llvm::cout << __FUNCTION__ << " ";        if (IdentifierInfo *II = D.getIdentifier()) {          llvm::cout << "'" << II->getName() << "'"; @@ -40,7 +40,7 @@ namespace {        llvm::cout << "\n";        // Pass up to EmptyActions so that the symbol table is maintained right. -      return MinimalAction::ActOnDeclarator(S, D, LastInGroup, AsmLabel); +      return MinimalAction::ActOnDeclarator(S, D, LastInGroup);      }      /// ActOnPopScope - This callback is called immediately before the specified      /// scope is popped and deleted. diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h index 4f7937a36ce..2b6f713441c 100644 --- a/clang/include/clang/Parse/Action.h +++ b/clang/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/clang/include/clang/Parse/DeclSpec.h b/clang/include/clang/Parse/DeclSpec.h index 68509145b9f..979f0204c5b 100644 --- a/clang/include/clang/Parse/DeclSpec.h +++ b/clang/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; }  }; diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp index 352925535dd..cb130c3d268 100644 --- a/clang/lib/Parse/MinimalAction.cpp +++ b/clang/lib/Parse/MinimalAction.cpp @@ -63,8 +63,7 @@ MinimalAction::isTypeName(const IdentifierInfo &II, Scope *S) {  /// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is  /// popped.  Action::DeclTy * -MinimalAction::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup, -                               ExprTy *AsmLabel) { +MinimalAction::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup) {    IdentifierInfo *II = D.getIdentifier();    // If there is no identifier associated with this declarator, bail out. diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 33482c5700f..1cf331702d9 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -256,13 +256,14 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {    // rest of the init-declarator-list.    while (1) {      // If a simple-asm-expr is present, parse it. -    ExprResult AsmLabel;      if (Tok.is(tok::kw_asm)) { -      AsmLabel = ParseSimpleAsm(); +      ExprResult AsmLabel = ParseSimpleAsm();        if (AsmLabel.isInvalid) {          SkipUntil(tok::semi);          return 0;        } +       +      D.setAsmLabel(AsmLabel.Val);      }      // If attributes are present, parse them. @@ -271,8 +272,7 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {      // Inform the current actions module that we just parsed this declarator.      // FIXME: pass asm & attributes. -    LastDeclInGroup = Actions.ActOnDeclarator(CurScope, D, LastDeclInGroup, -                                              AsmLabel.Val); +    LastDeclInGroup = Actions.ActOnDeclarator(CurScope, D, LastDeclInGroup);      // Parse declarator '=' initializer.      if (Tok.is(tok::equal)) { diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index b18c7eb3d4b..007970190bf 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -1222,7 +1222,7 @@ Parser::StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {            ParseDeclarator(DeclaratorInfo);            if (DeclaratorInfo.getIdentifier()) {              DeclTy *aBlockVarDecl = Actions.ActOnDeclarator(CurScope,  -                                                            DeclaratorInfo, 0, 0); +                                                          DeclaratorInfo, 0);              StmtResult stmtResult =                Actions.ActOnDeclStmt(aBlockVarDecl,                                       DS.getSourceRange().getBegin(), diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 864b464d5f1..0fda782fcb0 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -211,8 +211,7 @@ private:    // Symbol table / Decl tracking callbacks: SemaDecl.cpp.    //    virtual TypeTy *isTypeName(const IdentifierInfo &II, Scope *S); -  virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup, -                                  ExprTy *AsmLabel); +  virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);    virtual DeclTy *ActOnParamDeclarator(Scope *S, Declarator &D);    virtual void ActOnParamDefaultArgument(DeclTy *param,                                            SourceLocation EqualLoc, diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 64e62369e7f..19a2c28e267 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -609,7 +609,7 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType) {  }  Sema::DeclTy * -Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl, ExprTy *AsmLabel) { +Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {    ScopedDecl *LastDeclarator = dyn_cast_or_null<ScopedDecl>((Decl *)lastDecl);    IdentifierInfo *II = D.getIdentifier(); @@ -701,7 +701,7 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl, ExprTy *AsmLabe      ProcessDeclAttributes(NewFD, D);      // Handle GNU asm-label extension (encoded as an attribute). -    if (Expr *E = (Expr*) AsmLabel) { +    if (Expr *E = (Expr*) D.getAsmLabel()) {        // The parser guarantees this is a string.        StringLiteral *SE = cast<StringLiteral>(E);          NewFD->addAttr(new AsmLabelAttr(std::string(SE->getStrData(), @@ -1577,7 +1577,7 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {    }    return ActOnStartOfFunctionDef(FnBodyScope, -                                 ActOnDeclarator(GlobalScope, D, 0, 0)); +                                 ActOnDeclarator(GlobalScope, D, 0));  }  Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) { @@ -1669,7 +1669,7 @@ ScopedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,    CurContext = Context.getTranslationUnitDecl();    FunctionDecl *FD =  -    dyn_cast<FunctionDecl>(static_cast<Decl*>(ActOnDeclarator(TUScope, D, 0, 0))); +    dyn_cast<FunctionDecl>(static_cast<Decl*>(ActOnDeclarator(TUScope, D, 0)));    FD->setImplicit();    CurContext = PrevDC; diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index d5603166d8b..9dc62dcc4ab 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -371,7 +371,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,    if (isInstField)      Member = static_cast<Decl*>(ActOnField(S, Loc, D, BitWidth));    else -    Member = static_cast<Decl*>(ActOnDeclarator(S, D, LastInGroup, 0)); +    Member = static_cast<Decl*>(ActOnDeclarator(S, D, LastInGroup));    if (!Member) return LastInGroup;  | 

