[cfe-commits] r151229 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaInit.cpp test/CodeGenObjC/arc-blocks.m

Eli Friedman eli.friedman at gmail.com
Wed Mar 7 18:48:05 PST 2012


On Wed, Mar 7, 2012 at 6:42 PM, John McCall <rjmccall at apple.com> wrote:
> On Feb 22, 2012, at 6:25 PM, Eli Friedman wrote:
>> Author: efriedma
>> Date: Wed Feb 22 20:25:10 2012
>> New Revision: 151229
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=151229&view=rev
>> Log:
>> Try to handle qualifiers more consistently for array InitListExprs.  Fixes <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent.
>>
>> (I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.)
>>
>>
>> Modified:
>>    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
>>    cfe/trunk/lib/Sema/SemaDecl.cpp
>>    cfe/trunk/lib/Sema/SemaInit.cpp
>>    cfe/trunk/test/CodeGenObjC/arc-blocks.m
>>
>> Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=151229&r1=151228&r2=151229&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Wed Feb 22 20:25:10 2012
>> @@ -905,10 +905,8 @@
>>       }
>>     }
>>
>> -    QualType elementType = E->getType().getCanonicalType();
>> -    elementType = CGF.getContext().getQualifiedType(
>> -                    cast<ArrayType>(elementType)->getElementType(),
>> -                    elementType.getQualifiers() + Dest.getQualifiers());
>> +    QualType elementType =
>> +        CGF.getContext().getAsArrayType(E->getType())->getElementType();
>
> This seems to no longer propagate qualifiers from Dest.  Is there a situation where Dest can be, say, volatile where elementType would not be?

That shouldn't ever happen; preventing that was the point of the
changes to Sema.

-Eli




More information about the cfe-commits mailing list