diff options
author | Steve Naroff <snaroff@apple.com> | 2009-01-08 17:28:14 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-01-08 17:28:14 +0000 |
commit | 0701bbb228dfd87e1fe82a0a4b7b9facfecb43da (patch) | |
tree | 0e6483e9a1755c00b458662c0cd52c26d132b70e /lib/Sema/SemaOverload.cpp | |
parent | 7e5d6ed47dcedce35043de59ee00464b681bc786 (diff) |
This is a large/messy diff that unifies the ObjC AST's with DeclContext.
- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.
This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 704334d789..26ef1bdaa3 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -1117,7 +1117,7 @@ bool Sema::IsUserDefinedConversion(Expr *From, QualType ToType, = Context.DeclarationNames.getCXXConstructorName( Context.getCanonicalType(ToType)); DeclContext::lookup_iterator Con, ConEnd; - for (llvm::tie(Con, ConEnd) = ToRecordDecl->lookup(Context, ConstructorName); + for (llvm::tie(Con, ConEnd) = ToRecordDecl->lookup(ConstructorName); Con != ConEnd; ++Con) { CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con); if (Constructor->isConvertingConstructor()) @@ -2141,7 +2141,7 @@ void Sema::AddOperatorCandidates(OverloadedOperatorKind Op, Scope *S, // empty. if (const RecordType *T1Rec = T1->getAsRecordType()) { DeclContext::lookup_const_iterator Oper, OperEnd; - for (llvm::tie(Oper, OperEnd) = T1Rec->getDecl()->lookup(Context, OpName); + for (llvm::tie(Oper, OperEnd) = T1Rec->getDecl()->lookup(OpName); Oper != OperEnd; ++Oper) AddMethodCandidate(cast<CXXMethodDecl>(*Oper), Args[0], Args+1, NumArgs - 1, CandidateSet, @@ -3392,7 +3392,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object, OverloadCandidateSet CandidateSet; DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(OO_Call); DeclContext::lookup_const_iterator Oper, OperEnd; - for (llvm::tie(Oper, OperEnd) = Record->getDecl()->lookup(Context, OpName); + for (llvm::tie(Oper, OperEnd) = Record->getDecl()->lookup(OpName); Oper != OperEnd; ++Oper) AddMethodCandidate(cast<CXXMethodDecl>(*Oper), Object, Args, NumArgs, CandidateSet, /*SuppressUserConversions=*/false); @@ -3577,7 +3577,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc, const RecordType *BaseRecord = Base->getType()->getAsRecordType(); DeclContext::lookup_const_iterator Oper, OperEnd; - for (llvm::tie(Oper, OperEnd) = BaseRecord->getDecl()->lookup(Context, OpName); + for (llvm::tie(Oper, OperEnd) = BaseRecord->getDecl()->lookup(OpName); Oper != OperEnd; ++Oper) AddMethodCandidate(cast<CXXMethodDecl>(*Oper), Base, 0, 0, CandidateSet, /*SuppressUserConversions=*/false); |