[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 08:18:19 PST 2010


On Dec 1, 2010, at 8:17 AM, Peter Collingbourne wrote:

> Hi Doug,
> 
> On Wed, Dec 01, 2010 at 07:38:38AM -0800, Douglas Gregor wrote:
>>> +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.
> 
> The NVIDIA SDK headers say things like
> #define __global__ __attribute__((global))
> so we need to use this spelling here.
> 
> I agreed with Chris that the best way to disambiguate them is to rename
> the attributes at the AST level and keep the spellings.

Okay, I missed that discussion. Sorry!

	- Doug



More information about the cfe-commits mailing list