diff --git a/flang/include/flang/Optimizer/Dialect/FIRTypes.td b/flang/include/flang/Optimizer/Dialect/FIRTypes.td --- a/flang/include/flang/Optimizer/Dialect/FIRTypes.td +++ b/flang/include/flang/Optimizer/Dialect/FIRTypes.td @@ -324,7 +324,7 @@ void finalize(llvm::ArrayRef lenPList, llvm::ArrayRef typeList); - std::string getLoweredName() const; + std::string translateNameToFrontendMangledName() const; detail::RecordTypeStorage const *uniqueKey() const; }]; 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 @@ -1640,7 +1640,7 @@ mlir::Value getTypeDescriptor(BOX box, mlir::ConversionPatternRewriter &rewriter, mlir::Location loc, fir::RecordType recType) const { - std::string name = recType.getLoweredName(); + std::string name = recType.translateNameToFrontendMangledName(); auto module = box->template getParentOfType(); if (auto global = module.template lookupSymbol(name)) { auto ty = mlir::LLVM::LLVMPointerType::get( diff --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp --- a/flang/lib/Optimizer/Dialect/FIRType.cpp +++ b/flang/lib/Optimizer/Dialect/FIRType.cpp @@ -642,7 +642,7 @@ return std::numeric_limits::max(); } -std::string fir::RecordType::getLoweredName() const { +std::string fir::RecordType::translateNameToFrontendMangledName() const { auto split = getName().split('T'); std::string name = (split.first + "E.dt." + split.second).str(); return name;