diff options
author | John McCall <rjmccall@apple.com> | 2009-11-18 22:49:29 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-11-18 22:49:29 +0000 |
commit | 1f82f2462de797fe08587aa8e49d968fe6877efd (patch) | |
tree | cbc8233aa88886460e7840d675357ecc68ae9535 /clang/lib/Sema/Sema.h | |
parent | 11f305014100df85968020bf672e5236b1c81406 (diff) | |
download | bcm5719-llvm-1f82f2462de797fe08587aa8e49d968fe6877efd.tar.gz bcm5719-llvm-1f82f2462de797fe08587aa8e49d968fe6877efd.zip |
Overhaul previous-declaration and overload checking to work on lookup results
rather than NamedDecl*. This is a major step towards eliminating
OverloadedFunctionDecl.
llvm-svn: 89263
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r-- | clang/lib/Sema/Sema.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index e00c8a1e975..a4ff26669e2 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -548,27 +548,32 @@ public: DeclPtrTy HandleDeclarator(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, bool IsFunctionDefinition); - void RegisterLocallyScopedExternCDecl(NamedDecl *ND, NamedDecl *PrevDecl, + void RegisterLocallyScopedExternCDecl(NamedDecl *ND, + const LookupResult &Previous, Scope *S); void DiagnoseFunctionSpecifiers(Declarator& D); + bool CheckRedeclaration(DeclContext *DC, + DeclarationName Name, + SourceLocation NameLoc, + unsigned Diagnostic); NamedDecl* ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC, QualType R, DeclaratorInfo *DInfo, - NamedDecl* PrevDecl, bool &Redeclaration); + LookupResult &Previous, bool &Redeclaration); NamedDecl* ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC, QualType R, DeclaratorInfo *DInfo, - NamedDecl* PrevDecl, + LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &Redeclaration); - void CheckVariableDeclaration(VarDecl *NewVD, NamedDecl *PrevDecl, + void CheckVariableDeclaration(VarDecl *NewVD, LookupResult &Previous, bool &Redeclaration); NamedDecl* ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, QualType R, DeclaratorInfo *DInfo, - NamedDecl* PrevDecl, + LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool IsFunctionDefinition, bool &Redeclaration); void AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD); - void CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl, + void CheckFunctionDeclaration(FunctionDecl *NewFD, LookupResult &Previous, bool IsExplicitSpecialization, bool &Redeclaration, bool &OverloadableAttrRequired); @@ -780,15 +785,17 @@ public: /// Subroutines of ActOnDeclarator(). TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T, DeclaratorInfo *DInfo); - void MergeTypeDefDecl(TypedefDecl *New, Decl *Old); + void MergeTypeDefDecl(TypedefDecl *New, LookupResult &OldDecls); bool MergeFunctionDecl(FunctionDecl *New, Decl *Old); bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old); - void MergeVarDecl(VarDecl *New, Decl *Old); + void MergeVarDecl(VarDecl *New, LookupResult &OldDecls); bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old); /// C++ Overloading. - bool IsOverload(FunctionDecl *New, Decl* OldD, - OverloadedFunctionDecl::function_iterator &MatchedDecl); + bool IsOverload(FunctionDecl *New, LookupResult &OldDecls, + NamedDecl *&OldDecl); + bool IsOverload(FunctionDecl *New, FunctionDecl *Old); + ImplicitConversionSequence TryImplicitConversion(Expr* From, QualType ToType, bool SuppressUserConversions, @@ -2325,8 +2332,8 @@ public: const TemplateArgumentLoc *ExplicitTemplateArgs, unsigned NumExplicitTemplateArgs, SourceLocation RAngleLoc, - NamedDecl *&PrevDecl); - bool CheckMemberSpecialization(NamedDecl *Member, NamedDecl *&PrevDecl); + LookupResult &Previous); + bool CheckMemberSpecialization(NamedDecl *Member, LookupResult &Previous); virtual DeclResult ActOnExplicitInstantiation(Scope *S, |