[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 w

[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&id=124607#toc Repository: rL LLVM https://re

[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 wrote:

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

2017-11-28 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld accepted this revision. Hahnfeld added a comment. This revision is now accepted and ready to land. I'm fine if @rjmccall is fine - but looks like I need to accept this revision because I requested changes in the past? https://reviews.llvm.org/D40275 _

[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 wrote:

[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 case

[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 shouldDiagnoseTargetSupportFromOpen

[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 In

[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 creates

[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 wrote:

[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 ever

[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 wri

[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 check

[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 the

[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 instead

[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 http://lists.ll

[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 add

[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. https://reviews.llvm.org/