[flang-commits] [clang] [flang] [llvm] [OpenMP] Fix context selector matching and scoring (PR #231668)

via flang-commits flang-commits at lists.llvm.org
Fri Oct 16 23:09:00 PDT 2026


================
@@ -3039,6 +3043,47 @@ void OMPClausePrinter::VisitOMPXBareClause(OMPXBareClause *Node) {
   OS << "ompx_bare";
 }
 
+namespace {
+/// Canonical profiles identify template and function parameters only by
+/// position; add the declaration that owns each referenced parameter.
+class ParameterOwnerProfiler final : public ConstDynamicRecursiveASTVisitor {
+  llvm::FoldingSetNodeID &ID;
+
+  void addOwner(const Decl *D) {
+    if (isa_and_nonnull<ParmVarDecl, NonTypeTemplateParmDecl,
+                        TemplateTypeParmDecl, TemplateTemplateParmDecl>(D))
+      ID.AddPointer(cast<Decl>(D->getDeclContext())->getCanonicalDecl());
----------------
MattPD wrote:

`ParameterOwnerProfiler` is removed from this PR, so this case can move to the condition-identity follow-up.

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


More information about the flang-commits mailing list