[OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base
We can generate constant sized arrays whenever the array section has constant
length, even if the base expression itself is a VLA.
Differential Revision: https://reviews.llvm.org/D39504
llvm-svn: 317207
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 941ac75..243c6ed 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -9711,7 +9711,7 @@
}
if ((OASE && !ConstantLengthOASE) ||
- (!ASE &&
+ (!OASE && !ASE &&
D->getType().getNonReferenceType()->isVariablyModifiedType())) {
// For arrays/array sections only:
// Create pseudo array type for private copy. The size for this array will