[cfe-commits] r76717 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGValue.h lib/Sema/SemaExpr.cpp test/CodeGen/address-space-field1.c test/CodeGen/address-space-field2.c test/CodeGen/address-space-field3.c test/Co

Eli Friedman eli.friedman at gmail.com
Tue Jul 21 21:21:58 PDT 2009


On Tue, Jul 21, 2009 at 8:08 PM, Mon P Wang<wangmp at apple.com> wrote:
> Author: wangmp
> Date: Tue Jul 21 22:08:17 2009
> New Revision: 76717
>
> URL: http://llvm.org/viewvc/llvm-project?rev=76717&view=rev
> Log:
> Preserve address space information through member accesses, e.g.,
>   __attribute__((address_space(1))) struct {int arr[ 3 ]; }  *p1;
>   ... = p1->arr[2];  // load from address space 1

You're missing tests for the BuildAnonymousStructUnionMemberReference;
otherwise, the Sema changes look okay.  But please try to add some
tests that don't depend on CodeGen (a good way to verify types are
correct is to declare an object by directly writing out the type, then
re-declare it using an __typeof as the type).

The CodeGen changes look wrong; the address-space should already be
encoded in the type of the Value*, so it shouldn't be necessary to
separately encode it explicitly.  Also, as far as I can tell (correct
me if I'm wrong), they don't actually do anything, since you didn't
add any uses of the AddressSpace member.

-Eli




More information about the cfe-commits mailing list