[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

Peter Collingbourne peter at pcc.me.uk
Wed Dec 1 08:17:10 PST 2010


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.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list