[cfe-commits] r63320 - in /cfe/trunk/lib/Sema: Sema.h SemaDecl.cpp

steve naroff snaroff at apple.com
Thu Jan 29 11:13:25 PST 2009


On Jan 29, 2009, at 1:54 PM, Douglas Gregor wrote:

>
> On Jan 29, 2009, at 10:09 AM, Steve Naroff wrote:
>
>> Author: snaroff
>> Date: Thu Jan 29 12:09:31 2009
>> New Revision: 63320
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=63320&view=rev
>> Log:
>> Hack Sema::LookupDeclInScope() to avoid calling Sema::LookupName()  
>> when parsing C/ObjC.
>>
>> This results in a 1.7% improvement for "Cocoa.h". If we can figure  
>> out how to return a "Decl *", rather than a Sema::LookupResult(),  
>> we will likely bump the speedup from 1.7%->2.5%. I verified this,  
>> however couldn't get it to work without breaking a fair number of C+ 
>> + test cases. Will discuss with Doug offline.
>
>
> That's a lot of code repetition for 1.7%. Let's discuss this offline.
>

I would have preferred to optimize LookupName(), however it is more  
complex and needs to support more C++ features (LookupCriteria,  
LookupResult, etc.).

Since C++ support is a long way off, it would be really nice if name  
lookup cost (to C/ObjC) were minimal. Do you agree? If so, I'm hopeful  
we can improve the performance *without* resorting to code copying.

 From my perspective, a 2.5% penalty for parsing C/ObjC is unacceptable.

snaroff

> 	- Doug




More information about the cfe-commits mailing list