[cfe-commits] r120545 - in /cfe/trunk: include/clang/Basic/Attr.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/AttributeList.h lib/Sema/AttributeList.cpp lib/Sema/SemaDeclAttr.cpp test/CMakeLists.txt test/SemaCUDA/ test/SemaCUDA/cuda.h test/SemaCUDA/qualifiers.cu

Douglas Gregor dgregor at apple.com
Wed Dec 1 07:38:38 PST 2010


On Nov 30, 2010, at 7:15 PM, Peter Collingbourne wrote:

> Author: pcc
> Date: Tue Nov 30 21:15:31 2010
> New Revision: 120545
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=120545&view=rev
> Log:
> Basic, Sema: add support for CUDA location attributes
> 
> Added:
>    cfe/trunk/test/SemaCUDA/
>    cfe/trunk/test/SemaCUDA/cuda.h
>    cfe/trunk/test/SemaCUDA/qualifiers.cu
> Modified:
>    cfe/trunk/include/clang/Basic/Attr.td
>    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>    cfe/trunk/include/clang/Sema/AttributeList.h
>    cfe/trunk/lib/Sema/AttributeList.cpp
>    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
>    cfe/trunk/test/CMakeLists.txt
> 
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=120545&r1=120544&r2=120545&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/Attr.td (original)
> +++ cfe/trunk/include/clang/Basic/Attr.td Tue Nov 30 21:15:31 2010
> @@ -170,6 +170,26 @@
>   let Args = [IntArgument<"Priority">];
> }
> 
> +def CUDAConstant : Attr {
> +  let Spellings = ["constant"];
> +}
> +
> +def CUDADevice : Attr {
> +  let Spellings = ["device"];
> +}
> +
> +def CUDAGlobal : Attr {
> +  let Spellings = ["global"];
> +}
> +
> +def CUDAHost : Attr {
> +  let Spellings = ["host"];
> +}
> +
> +def CUDAShared : Attr {
> +  let Spellings = ["shared"];
> +}
> +

I'd feel more comfortable if these were spelled "cuda_constant", "cuda_device", "cuda_global", "cuda_host", and "cuda_shared", so they're guarantee not to conflict with future attributes. Nobody is actually going to write the attribute form anyway.

	- Doug





More information about the cfe-commits mailing list