[llvm-branch-commits] [llvm] [Frontend][OpenMP] Implement getLeafOrCompositeConstructs (PR #89104)

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Apr 23 02:20:12 PDT 2024


================
@@ -25,6 +25,43 @@ using namespace llvm::omp;
 #define GEN_DIRECTIVES_IMPL
 #include "llvm/Frontend/OpenMP/OMP.inc"
 
+static iterator_range<ArrayRef<Directive>::iterator>
+getFirstCompositeRange(iterator_range<ArrayRef<Directive>::iterator> Leafs) {
----------------
skatrak wrote:

Is there any reason for these functions to support unsupported lists of directives as input? I think it's worth having a simpler implementation over allowing all sorts of invalid lists of leaf constructs as input, unless there's a good reason why we'd need that.

Not saying that the compiler should crash in that case, but they can just return empty ranges for unsupported lists of leaf constructs rather than trying to find subsets that match what we're looking for.

https://github.com/llvm/llvm-project/pull/89104


More information about the llvm-branch-commits mailing list