Skip to content

Commit 3222234

Browse files
committed
Fix __ppc_intrinsics build
1 parent 4c8541d commit 3222234

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

flang/lib/Semantics/semantics.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,15 @@ bool Semantics::Perform() {
621621
const auto *frontModule{std::get_if<common::Indirection<parser::Module>>(
622622
&program_.v.front().u)};
623623
if (frontModule &&
624-
(std::get<parser::Statement<parser::ModuleStmt>>(frontModule->value().t)
625-
.statement.v.source == "__fortran_builtins" ||
626-
std::get<parser::Statement<parser::ModuleStmt>>(
627-
frontModule->value().t)
628-
.statement.v.source == "__ppc_types")) {
624+
std::get<parser::Statement<parser::ModuleStmt>>(frontModule->value().t)
625+
.statement.v.source == "__fortran_builtins") {
629626
// Don't try to read the builtins module when we're actually building it.
627+
} else if (frontModule &&
628+
std::get<parser::Statement<parser::ModuleStmt>>(frontModule->value().t)
629+
.statement.v.source == "__ppc_types") {
630+
// Don't try to read the UsePPCBuiltinTypesModule() we are currently
631+
// building, but __fortran_builtins is needed to build it.
632+
context_.UseFortranBuiltinsModule();
630633
} else if (frontModule &&
631634
(std::get<parser::Statement<parser::ModuleStmt>>(frontModule->value().t)
632635
.statement.v.source == "__ppc_intrinsics" ||

0 commit comments

Comments
 (0)