[clang] [clang][OpenMP] Simplify handling of implicit DSA/mapping information (PR #106786)
Krzysztof Parzyszek via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 6 10:04:29 PDT 2024
================
@@ -6060,69 +6057,55 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
return StmtError();
// Generate list of implicitly defined firstprivate variables.
VarsWithInheritedDSA = DSAChecker.getVarsWithInheritedDSA();
+ VariableImplicitInfo ImpInfo = DSAChecker.getImplicitInfo();
- SmallVector<Expr *, 4> ImplicitFirstprivates(
- DSAChecker.getImplicitFirstprivate());
- SmallVector<Expr *, 4> ImplicitPrivates(DSAChecker.getImplicitPrivate());
- const unsigned DefaultmapKindNum = OMPC_DEFAULTMAP_unknown + 1;
- SmallVector<Expr *, 4> ImplicitMaps[DefaultmapKindNum][OMPC_MAP_delete];
- SmallVector<OpenMPMapModifierKind, NumberOfOMPMapClauseModifiers>
- ImplicitMapModifiers[DefaultmapKindNum];
SmallVector<SourceLocation, NumberOfOMPMapClauseModifiers>
- ImplicitMapModifiersLoc[DefaultmapKindNum];
+ ImplicitMapModifiersLoc[VariableImplicitInfo::DefaultmapKindNum];
// Get the original location of present modifier from Defaultmap clause.
- SourceLocation PresentModifierLocs[DefaultmapKindNum];
+ SourceLocation PresentModifierLocs[VariableImplicitInfo::DefaultmapKindNum];
for (OMPClause *C : Clauses) {
if (auto *DMC = dyn_cast<OMPDefaultmapClause>(C))
if (DMC->getDefaultmapModifier() == OMPC_DEFAULTMAP_MODIFIER_present)
PresentModifierLocs[DMC->getDefaultmapKind()] =
DMC->getDefaultmapModifierLoc();
}
- for (unsigned VC = 0; VC < DefaultmapKindNum; ++VC) {
+
+ for (unsigned VC = 0; VC < VariableImplicitInfo::DefaultmapKindNum; ++VC) {
auto K = static_cast<OpenMPDefaultmapClauseKind>(VC);
----------------
kparzysz wrote:
Done, but I replaced the `OMPC_DEFAULTMAP_scalar` with 0. The auto-generated enum values aren't guaranteed to always have the same numerical value.
https://github.com/llvm/llvm-project/pull/106786
More information about the cfe-commits
mailing list