[flang] Change getLoweredName to translateNameToFrontendMangledName()
authorValentin Clement <clementval@gmail.com>
Tue, 25 Jan 2022 21:53:20 +0000 (22:53 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 26 Jan 2022 07:52:39 +0000 (08:52 +0100)
getLoweredName() is not a well suited name change it to
translateNameToFrontendMangledName()

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D118140

flang/include/flang/Optimizer/Dialect/FIRTypes.td
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/Dialect/FIRType.cpp

index baf9afe..62e794c 100644 (file)
@@ -324,7 +324,7 @@ def fir_RecordType : FIR_Type<"Record", "type"> {
     void finalize(llvm::ArrayRef<TypePair> lenPList,
                   llvm::ArrayRef<TypePair> typeList);
     
-    std::string getLoweredName() const;
+    std::string translateNameToFrontendMangledName() const;
 
     detail::RecordTypeStorage const *uniqueKey() const;
   }];
index 40d6d20..9072cf4 100644 (file)
@@ -1640,7 +1640,7 @@ struct EmboxCommonConversion : public FIROpConversion<OP> {
   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<mlir::ModuleOp>();
     if (auto global = module.template lookupSymbol<fir::GlobalOp>(name)) {
       auto ty = mlir::LLVM::LLVMPointerType::get(
index 0d087bc..7095af8 100644 (file)
@@ -642,7 +642,7 @@ unsigned fir::RecordType::getFieldIndex(llvm::StringRef ident) {
   return std::numeric_limits<unsigned>::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;