Skip to content

Commit 45d99c2

Browse files
authored
[clang][OpenMP] In 6.0, can omit length in array section (#148048)
In OpenMP 6.0 specification, section 5.2.5 Array Sections, page 166, lines 28-28: When the length is absent and the size of the dimension is not known, the array section is an assumed-size array. Testing - Updated LIT test - check-all - OpenMP_VV (formerly sollve) test case tests/6.0/target/test_target_assumed_array_size.c
1 parent f9d0bd0 commit 45d99c2

File tree

5 files changed

+376
-14
lines changed

5 files changed

+376
-14
lines changed

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ implementation.
443443
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
444444
| Traits for default device envirable | :none:`unclaimed` | :none:`unclaimed` | |
445445
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
446-
| Optionally omit array length expression | :none:`unclaimed` | :none:`unclaimed` | |
446+
| Optionally omit array length expression | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/148048 |
447447
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
448448
| Canonical loop sequences | :none:`unclaimed` | :none:`unclaimed` | |
449449
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ OpenMP Support
13161316
- Deprecation warning has been emitted for deprecated delimited form of ``declare target``.
13171317
- Added parsing and semantic analysis support for the 'need_device_addr'
13181318
modifier in the 'adjust_args' clause.
1319+
- Allow array length to be omitted in array section subscript expression.
13191320

13201321
Improvements
13211322
^^^^^^^^^^^^

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24392,7 +24392,7 @@ ExprResult SemaOpenMP::ActOnOMPArraySectionExpr(
2439224392
return ExprError();
2439324393
}
2439424394
}
24395-
} else if (ColonLocFirst.isValid() &&
24395+
} else if (SemaRef.getLangOpts().OpenMP < 60 && ColonLocFirst.isValid() &&
2439624396
(OriginalTy.isNull() || (!OriginalTy->isConstantArrayType() &&
2439724397
!OriginalTy->isVariableArrayType()))) {
2439824398
// OpenMP 5.0, [2.1.5 Array Sections]

0 commit comments

Comments
 (0)