[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
================
@@ -3053,24 +3098,38 @@ void OMPTraitInfo::getAsVariantMatchInfo(ASTContext &ASTCtx,
TraitProperty::user_condition_unknown &&
"Ill-formed user condition, expected unknown trait property!");
+ // Identify the condition by its original expression; substitution may
+ // fold different template parameters to the same value.
+ assert(Selector.OriginalCondition && "missing original condition");
+ const Expr *Condition =
+ Selector.OriginalCondition->IgnoreParenImpCasts();
+ llvm::FoldingSetNodeID ID;
+ Condition->Profile(ID, ASTCtx, /*Canonical=*/true);
+ ParameterOwnerProfiler(ID).TraverseStmt(Condition);
----------------
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