Skip to content

Commit cdf2bd8

Browse files
committed
Address copilot comments.
1 parent a941777 commit cdf2bd8

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
@@ -3579,8 +3579,8 @@ static void genOpenMPDeclareMapperImpl(
35793579
mapperNameStr = converter.mangleName(mapperNameStr, sym->owner());
35803580
}
35813581

3582-
// If the mapper op already exists (e.g., created by regular lowering),
3583-
// do not recreate it.
3582+
// If the mapper op already exists (e.g., created by regular lowering or by
3583+
// materialization of imported mappers), do not recreate it.
35843584
if (converter.getModuleOp().lookupSymbol(mapperNameStr))
35853585
return;
35863586

@@ -4272,12 +4272,8 @@ void Fortran::lower::materializeOpenMPDeclareMappers(
42724272
return;
42734273

42744274
// Only materialize for modules coming from mod files to avoid duplicates.
4275-
if (const semantics::Symbol *modSym = root.symbol()) {
4276-
if (!modSym->test(semantics::Symbol::Flag::ModFile))
4277-
return;
4278-
} else {
4275+
if (!root.symbol() || !root.symbol()->test(semantics::Symbol::Flag::ModFile))
42794276
return;
4280-
}
42814277

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

0 commit comments

Comments
 (0)