[flang-commits] [flang] 74acd74 - [flang] Change getLoweredName to translateNameToFrontendMangledName()

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Tue Jan 25 23:52:48 PST 2022


Author: Valentin Clement
Date: 2022-01-26T08:52:39+01:00
New Revision: 74acd744d35eebe4a6716026f5f3e9ee9bf15411

URL: https://github.com/llvm/llvm-project/commit/74acd744d35eebe4a6716026f5f3e9ee9bf15411
DIFF: https://github.com/llvm/llvm-project/commit/74acd744d35eebe4a6716026f5f3e9ee9bf15411.diff

LOG: [flang] Change getLoweredName to translateNameToFrontendMangledName()

getLoweredName() is not a well suited name change it to
translateNameToFrontendMangledName()

Reviewed By: schweitz

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/Dialect/FIRTypes.td b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
index baf9afe664976..62e794cc93e25 100644
--- a/flang/include/flang/Optimizer/Dialect/FIRTypes.td
+++ b/flang/include/flang/Optimizer/Dialect/FIRTypes.td
@@ -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;
   }];

diff  --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 40d6d2017b2fa..9072cf447e1d7 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -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(

diff  --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp
index 0d087bccf57d3..7095af8a71704 100644
--- a/flang/lib/Optimizer/Dialect/FIRType.cpp
+++ b/flang/lib/Optimizer/Dialect/FIRType.cpp
@@ -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;


        


More information about the flang-commits mailing list