On Nov 17, 2010, at 6:03 PM, Chris Lattner wrote:

> 
> On Nov 17, 2010, at 5:54 PM, Argyrios Kyrtzidis wrote:
> 
>> On Nov 17, 2010, at 3:51 PM, Argyrios Kyrtzidis wrote:
>> 
>>> 
>>>> 
>>>>> +  if (ReturnTy->isPODType() &&
>>>>> +      Diags.getDiagnosticLevel(diag::warn_return_value_size) !=
>>>>> +          Diagnostic::Ignored) {
>>>> 
>>>> Is this worth doing a 'is disabled' check for it?  It doesn't seem that 
>>>> expensive.  Does it cause a lot of PCH deserialization or something?
>>> 
>>> This is to allow disabling the warning through #pragma diagnostic.
>> 
>> Oops, disregard the above comment, I don't know what I was thinking.
>> 
>> ASTContext::getTypeInfo will calculate a ASTRecordLayout if one is not 
>> available.
>> It's debatable whether we will avoid it but better be on the safe side ?
> 
> When does this warning trigger?  IMO, it would make sense to only do it on 
> function definitions, not prototypes (because if you just have a proto, you 
> probably don't have the option to change it, and that way you don't get the 
> warning in every translation unit).

Yes, only on function definitions.

> 
> If it just triggers on definitions, the layout will have to be computed at 
> codegen time, so it shouldn't add any cost to -O0 compiles.

That's true but I was thinking about non-codegen situations like indexing ?

-Argiris

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


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

Reply via email to