diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 9 |
2 files changed, 13 insertions, 7 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 8bc212d302d..3ddf81974b6 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -51,9 +51,10 @@ ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC, VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, - StorageClass S, ScopedDecl *PrevDecl) { + StorageClass S, ScopedDecl *PrevDecl, + SourceLocation TypeSpecStartLoc) { void *Mem = C.getAllocator().Allocate<VarDecl>(); - return new (Mem) VarDecl(Var, DC, L, Id, T, S, PrevDecl); + return new (Mem) VarDecl(Var, DC, L, Id, T, S, PrevDecl, TypeSpecStartLoc); } ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC, @@ -68,9 +69,11 @@ FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, bool isInline, - ScopedDecl *PrevDecl) { + ScopedDecl *PrevDecl, + SourceLocation TypeSpecStartLoc) { void *Mem = C.getAllocator().Allocate<FunctionDecl>(); - return new (Mem) FunctionDecl(Function, DC, L, Id, T, S, isInline, PrevDecl); + return new (Mem) FunctionDecl(Function, DC, L, Id, T, S, isInline, PrevDecl, + TypeSpecStartLoc); } FieldDecl *FieldDecl::Create(ASTContext &C, SourceLocation L, diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8214fe4c631..1d755efd121 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -661,8 +661,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { } else { NewFD = FunctionDecl::Create(Context, CurContext, D.getIdentifierLoc(), - II, R, SC, isInline, - LastDeclarator); + II, R, SC, isInline, LastDeclarator, + // FIXME: Move to DeclGroup... + D.getDeclSpec().getSourceRange().getBegin()); } // Handle attributes. ProcessDeclAttributes(NewFD, D); @@ -766,7 +767,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { } } NewVD = VarDecl::Create(Context, CurContext, D.getIdentifierLoc(), - II, R, SC, LastDeclarator); + II, R, SC, LastDeclarator, + // FIXME: Move to DeclGroup... + D.getDeclSpec().getSourceRange().getBegin()); NewVD->setThreadSpecified(ThreadSpecified); } // Handle attributes prior to checking for duplicates in MergeVarDecl |

