This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.
ClosedPublic

Authored by jlebar on Sep 30 2016, 11:39 AM.

Details

Summary

This is probably the sane place for the attribute to go, but nvcc
specifically rejects it. Other GNU-style attributes are allowed in this
position (although judging from the warning it emits for
host/device/global, those attributes are applied to the lambda's
anonymous struct, not to the function itself).

It would be nice to have a FixIt message here, but doing so, or even
just getting the correct range for the attribute, including its '((' and
'))'s, is apparently Hard.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 73105.Sep 30 2016, 11:39 AM
jlebar retitled this revision from to [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'..
jlebar updated this object.
jlebar added a reviewer: rnk.
jlebar added subscribers: tra, cfe-commits.
rnk accepted this revision.Sep 30 2016, 11:50 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Sep 30 2016, 11:50 AM
This revision was automatically updated to reflect the committed changes.