[cfe-commits] r64667 - in /cfe/trunk: clang.xcodeproj/project.pbxproj include/clang/AST/Expr.h lib/CodeGen/CGExpr.cpp lib/Sema/SemaExpr.cpp test/Sema/ext_vector_components.c

Chris Lattner clattner at apple.com
Mon Feb 16 14:26:47 PST 2009


On Feb 16, 2009, at 1:25 PM, Eli Friedman wrote:

> On Mon, Feb 16, 2009 at 1:11 PM, Chris Lattner <sabre at nondot.org>  
> wrote:
>> +  // ExtVectorElementExpr's base can either be a vector or pointer  
>> to vector.
>> +  if (const PointerType *PT = E->getBase()->getType()- 
>> >getAsPointerType()) {
>
> Ugly; ExtVectorElementExpr should have an isArrow() property.

Yes, thanks.

>
>> +    llvm::Value *Ptr = EmitScalarExpr(E->getBase());
>> +    Base = LValue::MakeAddr(Ptr, PT- 
>> >getPointeeType().getCVRQualifiers());
>
> Do we distinguish between a volatile vector and a vector with volatile
> elements?

No, we don't.  elements of the vector can't be volatile.  However, the  
code was broken because the computed cvr qualifiers we overwritten in  
the code below.  This is fixed in r64683.

> In any case, it's not very clean to be using
> getCVRQualifiers on a non-canonical type.

You're right.  Unfortunately, codegen gets this wrong in a ton of  
places :(

-Chris



More information about the cfe-commits mailing list