[PATCH] make helper function static

Bas van den Berg b.van.den.berg.nl at gmail.com
Mon Dec 2 23:58:30 PST 2013


I did not measure it. The main reason was to narrow the scope so
reading/analysing the code
is easier.


On Tue, Dec 3, 2013 at 8:55 AM, Alp Toker <alp at nuanti.com> wrote:

>
> On 03/12/2013 07:44, Bas van den Berg wrote:
>
>> CheckImplicitConversion() can be static to allow more compiler
>> optimizations.
>>
>> ---
>>   lib/Sema/SemaChecking.cpp |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
>> index 0b95c48..830936d 100644
>> --- a/lib/Sema/SemaChecking.cpp
>> +++ b/lib/Sema/SemaChecking.cpp
>> @@ -5210,7 +5210,7 @@ void CheckImplicitArgumentConversions(Sema &S,
>> CallExpr *TheCall,
>>     }
>>   }
>>   -void CheckImplicitConversion(Sema &S, Expr *E, QualType T,
>> +static void CheckImplicitConversion(Sema &S, Expr *E, QualType T,
>>                                SourceLocation CC, bool *ICContext = 0) {
>>     if (E->isTypeDependent() || E->isValueDependent()) return;
>>
>>
>
> These functions are in an anonymous namespace so should get the same
> optimisations as 'static'.
>
> Did you see a difference in generated code / performance or was this just
> a speculative change?
>
> Alp.
>
>
> --
> http://www.nuanti.com
> the browser experts
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131203/f0d5153c/attachment.html>


More information about the cfe-commits mailing list