You beat me to it. Thanks Eli! On Oct 31, 2012, at 12:37 PM, Eli Friedman <[email protected]> wrote:
> On Wed, Oct 31, 2012 at 11:17 AM, Ulrich Weigand > <[email protected]> wrote: >> Author: uweigand >> Date: Wed Oct 31 13:17:07 2012 >> New Revision: 167148 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=167148&view=rev >> Log: >> Add "static" to some functions in altivec.c where it was missing. >> >> Added: >> cfe/trunk/test/Headers/altivec-header.c >> Modified: >> cfe/trunk/lib/Headers/altivec.h >> >> Modified: cfe/trunk/lib/Headers/altivec.h >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/altivec.h?rev=167148&r1=167147&r2=167148&view=diff >> ============================================================================== >> --- cfe/trunk/lib/Headers/altivec.h (original) >> +++ cfe/trunk/lib/Headers/altivec.h Wed Oct 31 13:17:07 2012 >> @@ -4363,14 +4363,14 @@ >> >> /* vec_vperm */ >> >> -vector signed char __ATTRS_o_ai >> +static vector signed char __ATTRS_o_ai >> vec_vperm(vector signed char a, vector signed char b, vector unsigned char c) >> { >> return (vector signed char) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector unsigned char __ATTRS_o_ai >> +static vector unsigned char __ATTRS_o_ai >> vec_vperm(vector unsigned char a, >> vector unsigned char b, >> vector unsigned char c) >> @@ -4379,21 +4379,21 @@ >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector bool char __ATTRS_o_ai >> +static vector bool char __ATTRS_o_ai >> vec_vperm(vector bool char a, vector bool char b, vector unsigned char c) >> { >> return (vector bool char) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector short __ATTRS_o_ai >> +static vector short __ATTRS_o_ai >> vec_vperm(vector short a, vector short b, vector unsigned char c) >> { >> return (vector short) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector unsigned short __ATTRS_o_ai >> +static vector unsigned short __ATTRS_o_ai >> vec_vperm(vector unsigned short a, >> vector unsigned short b, >> vector unsigned char c) >> @@ -4402,41 +4402,41 @@ >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector bool short __ATTRS_o_ai >> +static vector bool short __ATTRS_o_ai >> vec_vperm(vector bool short a, vector bool short b, vector unsigned char c) >> { >> return (vector bool short) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector pixel __ATTRS_o_ai >> +static vector pixel __ATTRS_o_ai >> vec_vperm(vector pixel a, vector pixel b, vector unsigned char c) >> { >> return (vector pixel) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector int __ATTRS_o_ai >> +static vector int __ATTRS_o_ai >> vec_vperm(vector int a, vector int b, vector unsigned char c) >> { >> return (vector int)__builtin_altivec_vperm_4si(a, b, c); >> } >> >> -vector unsigned int __ATTRS_o_ai >> +static vector unsigned int __ATTRS_o_ai >> vec_vperm(vector unsigned int a, vector unsigned int b, vector unsigned char >> c) >> { >> return (vector unsigned int) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector bool int __ATTRS_o_ai >> +static vector bool int __ATTRS_o_ai >> vec_vperm(vector bool int a, vector bool int b, vector unsigned char c) >> { >> return (vector bool int) >> __builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); >> } >> >> -vector float __ATTRS_o_ai >> +static vector float __ATTRS_o_ai >> vec_vperm(vector float a, vector float b, vector unsigned char c) >> { >> return (vector float) >> @@ -4445,7 +4445,7 @@ >> >> /* vec_re */ >> >> -vector float __attribute__((__always_inline__)) >> +static vector float __attribute__((__always_inline__)) >> vec_re(vector float a) >> { >> return __builtin_altivec_vrefp(a); >> @@ -4453,7 +4453,7 @@ >> >> /* vec_vrefp */ >> >> -vector float __attribute__((__always_inline__)) >> +static vector float __attribute__((__always_inline__)) >> vec_vrefp(vector float a) >> { >> return __builtin_altivec_vrefp(a); >> >> Added: cfe/trunk/test/Headers/altivec-header.c >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/altivec-header.c?rev=167148&view=auto >> ============================================================================== >> --- cfe/trunk/test/Headers/altivec-header.c (added) >> +++ cfe/trunk/test/Headers/altivec-header.c Wed Oct 31 13:17:07 2012 >> @@ -0,0 +1,11 @@ >> +// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec >> -ffreestanding -S -o - %s | FileCheck %s >> +// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec >> -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s >> +// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -maltivec >> -ffreestanding -x c++ -S -o - %s | FileCheck %s >> + >> +#include <altivec.h> >> + >> +// Verify that simply including <altivec.h> does not generate any code >> +// (i.e. all inline routines in the header are marked "static") >> + >> +// CHECK-NOT: .text >> + > > Please mark that this test requires the PPC backend. > > -Eli > _______________________________________________ > 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
