From 7f1cd5510e2238fb8535f66c827639f3eb7ab4f5 Mon Sep 17 00:00:00 2001 From: cdchen-ca Date: Fri, 1 Nov 2024 12:42:26 -0400 Subject: [PATCH 1/3] [OpenMP] Ignore the error introduced by -Wvla-cxx-extension on ompt-geenral.cpp. --- openmp/runtime/src/ompt-general.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp index 923eea2a563a9..c96bb3153b8a8 100644 --- a/openmp/runtime/src/ompt-general.cpp +++ b/openmp/runtime/src/ompt-general.cpp @@ -708,6 +708,9 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, return 0; #else int i, count; +#ifdef __clang_major__ >= 18 +#pragma clang diagnostic ignored "-Wvla-cxx-extension" +#endif int tmp_ids[ids_size]; for (int j = 0; j < ids_size; j++) tmp_ids[j] = 0; From 608bfd2b51a8c61f5a234971cfc7e40a0f8c5952 Mon Sep 17 00:00:00 2001 From: cdchen-ca Date: Fri, 1 Nov 2024 16:36:56 -0400 Subject: [PATCH 2/3] [OpenMP] to address the review comments to use template SimpleVLA. --- openmp/runtime/src/ompt-general.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp index c96bb3153b8a8..ef79e78891fd9 100644 --- a/openmp/runtime/src/ompt-general.cpp +++ b/openmp/runtime/src/ompt-general.cpp @@ -23,6 +23,7 @@ #if KMP_OS_UNIX #include #endif +#include "kmp_utils.h" /***************************************************************************** * ompt include files @@ -708,10 +709,7 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, return 0; #else int i, count; -#ifdef __clang_major__ >= 18 -#pragma clang diagnostic ignored "-Wvla-cxx-extension" -#endif - int tmp_ids[ids_size]; + SimpleVLA tmp_ids(ids_size); for (int j = 0; j < ids_size; j++) tmp_ids[j] = 0; if (!KMP_AFFINITY_CAPABLE()) From 8ff63040a41ab25efe98878aa6e66b9bc3546aec Mon Sep 17 00:00:00 2001 From: cdchen-ca Date: Mon, 4 Nov 2024 10:59:26 -0500 Subject: [PATCH 3/3] Move LLVM headers before system headers. --- openmp/runtime/src/ompt-general.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp index ef79e78891fd9..cd738f066fcfc 100644 --- a/openmp/runtime/src/ompt-general.cpp +++ b/openmp/runtime/src/ompt-general.cpp @@ -10,10 +10,11 @@ // //===----------------------------------------------------------------------===// +#include "kmp_utils.h" + /***************************************************************************** * system include files ****************************************************************************/ - #include #include @@ -23,7 +24,6 @@ #if KMP_OS_UNIX #include #endif -#include "kmp_utils.h" /***************************************************************************** * ompt include files