[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. tra wrote: > rjmccall

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-28 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL319201: [CUDA] Report "unsupported VLA" errors only on device side. (authored by tra). Changed prior to commit: https://reviews.llvm.org/D40275?vs=123831=124607#toc Repository: rL LLVM

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-28 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. rjmccall wrote: > tra

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. tra wrote: > tra

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-28 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. In https://reviews.llvm.org/D40275#937010, @tra wrote: > In https://reviews.llvm.org/D40275#933253, @tra wrote: > > > @rjmccall : are you OK with this approach? If VLA is not supported by the > > target, CUDA is handled as a special

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-27 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D40275#933253, @tra wrote: > @rjmccall : are you OK with this approach? If VLA is not supported by the > target, CUDA is handled as a special case so it can emit deferred diag, > OpenMP reports an error only if

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-22 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. @rjmccall : are you OK with this approach? If VLA is not supported by the target, CUDA is handled as a special case so it can emit deferred diag, OpenMP reports an error only if shouldDiagnoseTargetSupportFromOpenMP() allows it, and everything else does so unconditionally.

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 123831. tra added a comment. Updated CUDA tests https://reviews.llvm.org/D40275 Files: clang/lib/Sema/SemaType.cpp clang/test/SemaCUDA/call-stack-for-deferred-err.cu clang/test/SemaCUDA/no-call-stack-for-immediate-errs.cu clang/test/SemaCUDA/vla.cu

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D40275#931947, @hfinkel wrote: > > When Sema sees this code during compilation, it can not tell whether there > > is an error. Calling foo from the host code is perfectly valid. Calling it > > from device code is not. CUDADiagIfDeviceCode

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. tra wrote: > rjmccall

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 123823. tra added a comment. Updated to partially address rjmccall@ comments. https://reviews.llvm.org/D40275 Files: clang/lib/Sema/SemaType.cpp clang/test/SemaCUDA/vla.cu Index: clang/test/SemaCUDA/vla.cu

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment. > When Sema sees this code during compilation, it can not tell whether there is > an error. Calling foo from the host code is perfectly valid. Calling it from > device code is not. CUDADiagIfDeviceCode creates 'postponed' diagnostics > which only gets emitted if we

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-21 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. rjmccall wrote: > Please

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:2188 + !Context.getTargetInfo().isVLASupported() && + shouldDiagnoseTargetSupportFromOpenMP()) { + // Some targets don't support VLAs. Please write this

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 123694. tra added a comment. Updates CUDA's VLA test to use nvptx triple. https://reviews.llvm.org/D40275 Files: clang/lib/Sema/SemaType.cpp clang/test/SemaCUDA/vla.cu Index: clang/test/SemaCUDA/vla.cu

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. In https://reviews.llvm.org/D40275#930981, @tra wrote: > In https://reviews.llvm.org/D40275#930948, @Hahnfeld wrote: > > > In https://reviews.llvm.org/D39505 @rjmccall requested that the check > > should be made independent of the language. To preserve this, I think

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D40275#930982, @Hahnfeld wrote: > And please add a regression test which is apparently missing for the case > that a VLA is **NOT** diagnosed in CUDA mode Hmm. We do have test/SemaCUDA/vla.cu which should've triggered the error. Let me see why

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D40275#930948, @Hahnfeld wrote: > In https://reviews.llvm.org/D39505 @rjmccall requested that the check should > be made independent of the language. To preserve this, I think the CUDA > specific checks should be added to the generic case

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. And please add a regression test which is apparently missing for the case that a VLA is **NOT** diagnosed in CUDA mode https://reviews.llvm.org/D40275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld requested changes to this revision. Hahnfeld added a comment. This revision now requires changes to proceed. In https://reviews.llvm.org/D39505 @rjmccall requested that the check should be made independent of the language. To preserve this, I think the CUDA specific checks should be

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 123690. tra added a comment. Folded OpenCL check under `if (T->isVariableArrayType())` https://reviews.llvm.org/D40275 Files: clang/lib/Sema/SemaType.cpp Index: clang/lib/Sema/SemaType.cpp ===

[PATCH] D40275: [CUDA] Report "unsupported VLA" errors only on device side.

2017-11-20 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. Herald added a subscriber: sanjoy. This fixes erroneously reported CUDA compilation errors in host-side code during device-side compilation. I've also restricted OpenMP-specific checks to trigger only if we're compiling with OpenMP enabled.