Skip to content

Commit 83ab55c

Browse files
committed
Address copilot comments.
1 parent 672eb0e commit 83ab55c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,8 +3569,8 @@ static void genOpenMPDeclareMapperImpl(
35693569
mapperNameStr = converter.mangleName(mapperNameStr, sym->owner());
35703570
}
35713571

3572-
// If the mapper op already exists (e.g., created by regular lowering),
3573-
// do not recreate it.
3572+
// If the mapper op already exists (e.g., created by regular lowering or by
3573+
// materialization of imported mappers), do not recreate it.
35743574
if (converter.getModuleOp().lookupSymbol(mapperNameStr))
35753575
return;
35763576

@@ -4262,12 +4262,8 @@ void Fortran::lower::materializeOpenMPDeclareMappers(
42624262
return;
42634263

42644264
// Only materialize for modules coming from mod files to avoid duplicates.
4265-
if (const semantics::Symbol *modSym = root.symbol()) {
4266-
if (!modSym->test(semantics::Symbol::Flag::ModFile))
4267-
return;
4268-
} else {
4265+
if (!root.symbol() || !root.symbol()->test(semantics::Symbol::Flag::ModFile))
42694266
return;
4270-
}
42714267

42724268
// Scan symbols in this module scope for MapperDetails.
42734269
for (auto &it : root) {

0 commit comments

Comments
 (0)