r179436 - Speed-up ObjCMethodDecl::getOverriddenMethods().
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Apr 15 09:58:42 PDT 2013
On Apr 14, 2013, at 10:51 AM, jahanian <fjahanian at apple.com> wrote:
> Is there anecdotal evidence of speed improvement (other than the obvious multiple iteration removal)?
I'm doing measurements using libclang, which is a heavy user of that function.
>
> - fariborz
>
> On Apr 12, 2013, at 6:04 PM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
>
>> Author: akirtzidis
>> Date: Fri Apr 12 20:04:01 2013
>> New Revision: 179436
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=179436&view=rev
>> Log:
>> Speed-up ObjCMethodDecl::getOverriddenMethods().
>>
>> Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
>> results instead of re-calculating the categories multiple times.
>>
>> Modified: cfe/trunk/lib/AST/ASTContext.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=179436&r1=179435&r2=179436&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/AST/ASTContext.cpp (original)
>> +++ cfe/trunk/lib/AST/ASTContext.cpp Fri Apr 12 20:04:01 2013
>> @@ -1127,8 +1127,8 @@ void ASTContext::getOverriddenMethods(
>> assert(D);
>>
>> if (const CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
>> - Overridden.append(CXXMethod->begin_overridden_methods(),
>> - CXXMethod->end_overridden_methods());
>> + Overridden.append(overridden_methods_begin(CXXMethod),
>> + overridden_methods_end(CXXMethod));
>> return;
>> }
>>
>> @@ -1141,6 +1141,39 @@ void ASTContext::getOverriddenMethods(
>> Overridden.append(OverDecls.begin(), OverDecls.end());
>> }
>>
>> +void ASTContext::getBaseObjCCategoriesAfterInterface(
>> +
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130415/dda68b52/attachment.html>
More information about the cfe-commits
mailing list