[OpenMP] Using SimpleVLA to handle vla usage in ompt-general.cpp. (#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.
This commit is contained in:
Daniel Chen 2024-11-04 12:42:16 -05:00 committed by GitHub
parent 186dc9a4df
commit d3d8103d53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,11 @@
//
//===----------------------------------------------------------------------===//
#include "kmp_utils.h"
/*****************************************************************************
* system include files
****************************************************************************/
#include <assert.h>
#include <stdint.h>
@ -708,7 +709,7 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size,
return 0;
#else
int i, count;
int tmp_ids[ids_size];
SimpleVLA<int> tmp_ids(ids_size);
for (int j = 0; j < ids_size; j++)
tmp_ids[j] = 0;
if (!KMP_AFFINITY_CAPABLE())