================ @@ -8,12 +8,74 @@ #include "llvm/Frontend/OpenMP/OMP.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" +#include <algorithm> +#include <iterator> +#include <type_traits> + using namespace llvm; -using namespace omp; +using namespace llvm::omp; #define GEN_DIRECTIVES_IMPL #include "llvm/Frontend/OpenMP/OMP.inc" + +namespace llvm::omp { +ArrayRef<Directive> getLeafConstructs(Directive D) { + auto Idx = static_cast<int>(D); + if (Idx < 0 || Idx >= static_cast<int>(Directive_enumSize)) ---------------- skatrak wrote:
Nit: `Directive_enumSize` seems to be of `std::size_t` type, so maybe this can be simplified a bit: ```suggestion auto Idx = static_cast<std::size_t>(D); if (Idx >= Directive_enumSize) ``` https://github.com/llvm/llvm-project/pull/87247 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits