[OpenMP] Show error if VLAs are not supported
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Sat, 18 Nov 2017 21:00:46 +0000 (21:00 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Sat, 18 Nov 2017 21:00:46 +0000 (21:00 +0000)
commit87d44269885f100a2a039e628919a34748a720e5
tree2722ddd24350ed7b874e1c49f90dd80380b92787
parent9b1dc4c2756dc25f38caa0cf6e6b71d70295b2d1
[OpenMP] Show error if VLAs are not supported

Some target devices (e.g. Nvidia GPUs) don't support dynamic stack
allocation and hence no VLAs. Print errors with description instead
of failing in the backend or generating code that doesn't work.

This patch handles explicit uses of VLAs (local variable in target
or declare target region) or implicitly generated (private) VLAs
for reductions on VLAs or on array sections with non-constant size.

Differential Revision: https://reviews.llvm.org/D39505

llvm-svn: 318601
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Basic/TargetInfo.h
clang/include/clang/Sema/Sema.h
clang/lib/Basic/TargetInfo.cpp
clang/lib/Basic/Targets/NVPTX.cpp
clang/lib/Basic/Targets/SPIR.h
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/SemaType.cpp
clang/test/OpenMP/target_vla_messages.cpp [new file with mode: 0644]