This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Report an error if code tries to mix incompatible CUDA attributes.
ClosedPublic

Authored by jlebar on Jan 12 2016, 4:32 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 44695.Jan 12 2016, 4:32 PM
jlebar retitled this revision from to [CUDA] Report an error if code tries to mix incompatible CUDA attributes..
jlebar updated this object.
jlebar added reviewers: tra, echristo.
jlebar added a subscriber: jhen.
tra added inline comments.Jan 12 2016, 4:43 PM
lib/Sema/SemaDeclAttr.cpp
364 ↗(On Diff #44695)

No need for {}

test/SemaCUDA/bad-attributes.cu
11–19 ↗(On Diff #44695)

Those are already defined in Inputs/cuda.h in the test directory:

#include "Inputs/cuda.h"
33–34 ↗(On Diff #44695)

Those are unsupported stubs that exist only to avoid warnings when we include CUDA headers.
No point testing for them here IMO.

jlebar updated this revision to Diff 44696.Jan 12 2016, 4:51 PM
jlebar marked 3 inline comments as done.

Address tra's review comments.

Thank you for the review.

lib/Sema/SemaDeclAttr.cpp
364 ↗(On Diff #44695)

For once this was intentional; this if body is multiline. See also handleGlobalAttr below.

I'm happy to do whatever the style is, but I really hope it doesn't prescribe no braces here.

test/SemaCUDA/bad-attributes.cu
33–34 ↗(On Diff #44695)

Done. I presume the same applies to cudart_builtin, nv_weak, device_builtin_surface_type, and device_builtin_texture_type?

tra edited edge metadata.Jan 12 2016, 5:02 PM

LGTM

This revision was automatically updated to reflect the committed changes.
cfe/trunk/test/SemaCUDA/attributes-on-non-cuda.cu