Skip to content

Commit 317280f

Browse files
committed
Fix build failure.
1 parent b7891dd commit 317280f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

flang/include/flang/Lower/OpenMP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct OmpClauseList;
4141

4242
namespace semantics {
4343
class Symbol;
44+
class Scope;
4445
class SemanticsContext;
4546
} // namespace semantics
4647

flang/lib/Semantics/resolve-names.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,11 +1886,12 @@ void OmpVisitor::ProcessMapperSpecifier(const parser::OmpMapperSpecifier &spec,
18861886
auto &mapperName{std::get<std::string>(spec.t)};
18871887
// Create or update the mapper symbol with MapperDetails and
18881888
// keep track of the declarative construct for module emission.
1889-
Symbol &mapperSym{MakeSymbol(parser::CharBlock(mapperName), Attrs{})};
1890-
if (auto *md{mapperSym.detailsIf<MapperDetails>()}) {
1891-
md->AddDecl(declaratives_.back());
1892-
} else if (mapperSym.has<UnknownDetails>() || mapperSym.has<MiscDetails>()) {
1889+
SourceName mapperSource{context().SaveTempName(std::string{mapperName})};
1890+
Symbol &mapperSym{MakeSymbol(mapperSource, Attrs{})};
1891+
if (!mapperSym.detailsIf<MapperDetails>()) {
18931892
mapperSym.set_details(MapperDetails{});
1893+
}
1894+
if (!context().langOptions().OpenMPSimd) {
18941895
mapperSym.get<MapperDetails>().AddDecl(declaratives_.back());
18951896
}
18961897
PushScope(Scope::Kind::OtherConstruct, nullptr);

0 commit comments

Comments
 (0)