Skip to content

Commit d3d8103

Browse files
authored
[OpenMP] Using SimpleVLA to handle vla usage in ompt-general.cpp. (llvm#114583)
The `openmp` runtime failed to build on LoP with LLVM18 on LoP due to the addition of `-Wvla-cxx-extension` as ``` llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 711 | int tmp_ids[ids_size]; | ^~~~~~~~ llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: note: function parameter 'ids_size' with unknown value cannot be used in a constant expression llvm-project/openmp/runtime/src/ompt-general.cpp:704:65: note: declared here 704 | OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, | ^ 1 error generated. ``` This patch is to ignore the checking against this usage.
1 parent 186dc9a commit d3d8103

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

openmp/runtime/src/ompt-general.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "kmp_utils.h"
14+
1315
/*****************************************************************************
1416
* system include files
1517
****************************************************************************/
16-
1718
#include <assert.h>
1819

1920
#include <stdint.h>
@@ -708,7 +709,7 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size,
708709
return 0;
709710
#else
710711
int i, count;
711-
int tmp_ids[ids_size];
712+
SimpleVLA<int> tmp_ids(ids_size);
712713
for (int j = 0; j < ids_size; j++)
713714
tmp_ids[j] = 0;
714715
if (!KMP_AFFINITY_CAPABLE())

0 commit comments

Comments
 (0)