diff --git a/flang/include/flang/Optimizer/Support/InternalNames.h b/flang/include/flang/Optimizer/Support/InternalNames.h --- a/flang/include/flang/Optimizer/Support/InternalNames.h +++ b/flang/include/flang/Optimizer/Support/InternalNames.h @@ -133,7 +133,7 @@ /// Check whether the name should be re-mangle with external ABI convention. static bool needExternalNameMangling(llvm::StringRef uniquedName); - /// Does \p uniquedName belong to module \p moduleName ? + /// Does \p uniquedName belong to module \p moduleName? static bool belongsToModule(llvm::StringRef uniquedName, llvm::StringRef moduleName); diff --git a/flang/include/flang/Semantics/runtime-type-info.h b/flang/include/flang/Semantics/runtime-type-info.h --- a/flang/include/flang/Semantics/runtime-type-info.h +++ b/flang/include/flang/Semantics/runtime-type-info.h @@ -33,8 +33,8 @@ RuntimeDerivedTypeTables BuildRuntimeDerivedTypeTables(SemanticsContext &); -// Name of the builtin module that defines builtin derived types meant -// to describe other derived types at runtime in flang descriptor. +/// Name of the builtin module that defines builtin derived types meant +/// to describe other derived types at runtime in flang descriptor. constexpr char typeInfoBuiltinModule[]{"__fortran_type_info"}; } // namespace Fortran::semantics diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -1667,18 +1667,18 @@ return rewriter.create(loc, ty, global.getSymName()); } - auto i8Ty = rewriter.getIntegerType(8); if (fir::NameUniquer::belongsToModule( name, Fortran::semantics::typeInfoBuiltinModule)) { // Type info derived types do not have type descriptors since they are the // types defining type descriptors. - auto i8PtrTy = mlir::LLVM::LLVMPointerType::get(i8Ty); - return rewriter.create(loc, i8PtrTy); + return rewriter.create( + loc, ::getVoidPtrType(box.getContext())); } // The global does not exist in the current translation unit, but may be // defined elsewhere (e.g., type defined in a module). // Create an available_externally global to require the symbols to be // defined elsewhere and to cause link-time failure otherwise. + auto i8Ty = rewriter.getIntegerType(8); mlir::OpBuilder modBuilder(module.getBodyRegion()); modBuilder.create( loc, i8Ty, /*isConstant=*/true,