]> granicus.if.org Git - clang/commit
In the final step for preserving typedef info better in the AST, upgrade
authorChris Lattner <sabre@nondot.org>
Mon, 16 Jul 2007 22:05:22 +0000 (22:05 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 16 Jul 2007 22:05:22 +0000 (22:05 +0000)
commita2c7767ce7d8feb10253f4b650826a20f3324c6f
tree7a6bc8bd0925f0972f9c8176bd3a6a29d419fa9c
parentc80b4eefa221f10871e7fed0ab9dc7d9d3d07dd0
In the final step for preserving typedef info better in the AST, upgrade
isPointerType and isVectorType to only look through a single level of typedef
when one is present.  For this invalid code:

typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
typedef int4* int4p;
void test(float4 a, int4p result, int i) {
    result[i] = a;
}

we now get:

t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
    result[i] = a;
    ~~~~~~~~~ ^ ~

instead of:

t.c:5:15: error: incompatible types assigning 'float4' to 'int  __attribute__((vector_size(16)))'
    result[i] = a;
    ~~~~~~~~~ ^ ~

The rest of the type predicates should be upgraded to do the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39932 91177308-0d34-0410-b5e6-96231b3b80d8
AST/Type.cpp
include/clang/AST/Type.h