diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-12-27 03:58:08 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-12-27 03:58:08 +0000 |
commit | 2e0c8f79d97b974a680087d12a7dc5e1dc705c20 (patch) | |
tree | 39a5eec66a84c82be84d24b102a61991a5b226a5 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | c33b2fd0add3d1a77b19874c6a1dd91f5a59f8a3 (diff) | |
download | llvm-2e0c8f79d97b974a680087d12a7dc5e1dc705c20.zip llvm-2e0c8f79d97b974a680087d12a7dc5e1dc705c20.tar.gz llvm-2e0c8f79d97b974a680087d12a7dc5e1dc705c20.tar.bz2 |
Address review feedback on r221933.
Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in
the low bit of the ObjCMethodDecl pointer, using a PointerIntPair.
Most of this patch is replacing ".Method" with ".getMethod()".
No intended behavior change.
llvm-svn: 224876
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 50d51348..48bdd2a 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -5404,13 +5404,13 @@ static void AddClassMessageCompletions(Sema &SemaRef, Scope *S, MEnd = SemaRef.MethodPool.end(); M != MEnd; ++M) { for (ObjCMethodList *MethList = &M->second.second; - MethList && MethList->Method; + MethList && MethList->getMethod(); MethList = MethList->getNext()) { - if (!isAcceptableObjCMethod(MethList->Method, MK_Any, SelIdents)) + if (!isAcceptableObjCMethod(MethList->getMethod(), MK_Any, SelIdents)) continue; - Result R(MethList->Method, Results.getBasePriority(MethList->Method), - nullptr); + Result R(MethList->getMethod(), + Results.getBasePriority(MethList->getMethod()), nullptr); R.StartParameter = SelIdents.size(); R.AllParametersAreInformative = false; Results.MaybeAddResult(R, SemaRef.CurContext); @@ -5577,16 +5577,16 @@ void Sema::CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver, MEnd = MethodPool.end(); M != MEnd; ++M) { for (ObjCMethodList *MethList = &M->second.first; - MethList && MethList->Method; + MethList && MethList->getMethod(); MethList = MethList->getNext()) { - if (!isAcceptableObjCMethod(MethList->Method, MK_Any, SelIdents)) + if (!isAcceptableObjCMethod(MethList->getMethod(), MK_Any, SelIdents)) continue; - if (!Selectors.insert(MethList->Method->getSelector()).second) + if (!Selectors.insert(MethList->getMethod()->getSelector()).second) continue; - Result R(MethList->Method, Results.getBasePriority(MethList->Method), - nullptr); + Result R(MethList->getMethod(), + Results.getBasePriority(MethList->getMethod()), nullptr); R.StartParameter = SelIdents.size(); R.AllParametersAreInformative = false; Results.MaybeAddResult(R, CurContext); @@ -6994,16 +6994,18 @@ void Sema::CodeCompleteObjCMethodDeclSelector(Scope *S, M != MEnd; ++M) { for (ObjCMethodList *MethList = IsInstanceMethod ? &M->second.first : &M->second.second; - MethList && MethList->Method; + MethList && MethList->getMethod(); MethList = MethList->getNext()) { - if (!isAcceptableObjCMethod(MethList->Method, MK_Any, SelIdents)) + if (!isAcceptableObjCMethod(MethList->getMethod(), MK_Any, SelIdents)) continue; if (AtParameterName) { // Suggest parameter names we've seen before. unsigned NumSelIdents = SelIdents.size(); - if (NumSelIdents && NumSelIdents <= MethList->Method->param_size()) { - ParmVarDecl *Param = MethList->Method->parameters()[NumSelIdents-1]; + if (NumSelIdents && + NumSelIdents <= MethList->getMethod()->param_size()) { + ParmVarDecl *Param = + MethList->getMethod()->parameters()[NumSelIdents - 1]; if (Param->getIdentifier()) { CodeCompletionBuilder Builder(Results.getAllocator(), Results.getCodeCompletionTUInfo()); @@ -7016,8 +7018,8 @@ void Sema::CodeCompleteObjCMethodDeclSelector(Scope *S, continue; } - Result R(MethList->Method, Results.getBasePriority(MethList->Method), - nullptr); + Result R(MethList->getMethod(), + Results.getBasePriority(MethList->getMethod()), nullptr); R.StartParameter = SelIdents.size(); R.AllParametersAreInformative = false; R.DeclaringEntity = true; |