On Jan 3, 2011, at 3:57 PM, Chris Lattner wrote:

> 
> On Jan 3, 2011, at 2:33 PM, Argyrios Kyrtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Mon Jan  3 16:33:06 2011
>> New Revision: 122781
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=122781&view=rev
>> Log:
>> When in code-completion, skip obj-c method bodies for speed up.
> 
> Very nice.  A minor comment on the style of this.  Instead of:
> 
>> +  if (MaybeSkipFunctionBodyForCodeCompletion())
>> +    return Actions.ActOnFinishFunctionBody(MDecl, 0);
> 
> I'd prefer that this look like:
> 
>  if (PP.isCodeCompletionEnabled())
>    if (trySkippingFunctionBodyForCodeCompletion())
>      return Actions.ActOnFinishFunctionBody(MDecl, 0);
> 
> Reasons why:
> 
> 1. This isn't a hot codepath, but this is more efficient because the call 
> won't happen when not in code completion mode.
> 2. "Maybe" as a prefix is bad because it doesn't mean anything :), and 
> because it is capitalized.
> 3. It's now really clear reading this in Parser that this has no impact when 
> code completion is off.

Done in r122792.
Though, for 2., note that 'maybe' as a prefix is used extensively.

> 
> -Chris


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to