================
@@ -702,6 +745,170 @@ void OmpStructureChecker::CheckTraitSimd(
}
}
+void OmpStructureChecker::CollectMetadirectiveConstructSelectors(
+ const parser::ProgramUnit &programUnit) {
+ metadirectiveConstructSelectors_.clear();
+ MetadirectiveConstructSelectorCollector collector{
+ metadirectiveConstructSelectors_};
+ parser::Walk(programUnit, collector);
+}
+
+OmpStructureChecker::ConstructTraitSequence
+OmpStructureChecker::GetConstructTraitsForPath(
+ const EffectiveDirectivePath &path) const {
+ ConstructTraitSequence constructTraits;
+ for (auto directive{path.rbegin()}; directive != path.rend(); ++directive) {
+ // The construct trait set starts at the innermost target construct.
+ if (llvm::omp::allTargetSet.test(*directive)) {
+ constructTraits.clear();
+ }
+ for (llvm::omp::Directive leaf :
+ llvm::omp::getLeafConstructsOrSelf(*directive)) {
+ if (leaf == llvm::omp::Directive::OMPD_nothing ||
+ leaf == llvm::omp::Directive::OMPD_unknown) {
+ continue;
+ }
+ llvm::omp::VariantMatchInfo leafVMI;
+ AppendConstructTraitsForDirective(leaf, leafVMI);
+ if (leafVMI.ConstructTraits.empty()) {
+ // Source constructs without selector traits still occupy positions
+ // in the scoring context, including leaves of combined directives.
+ constructTraits.push_back(llvm::omp::TraitProperty::invalid);
----------------
MattPD wrote:
Confirmed at 20b4d70: Semantics and lowering now agree on the construct
positions covered by this thread.
https://github.com/llvm/llvm-project/pull/219014
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits