diff options
author | River Riddle <riddleriver@gmail.com> | 2022-03-08 06:13:02 +0300 |
---|---|---|
committer | River Riddle <riddleriver@gmail.com> | 2022-03-08 23:25:32 +0300 |
commit | f8d5c73c825c19e0c88ff4b7f1900667f06161aa (patch) | |
tree | 50bc8944e1e3a68e4b24da6056692dbe9592d08e /flang | |
parent | 171850c55aaea3044a98aa573b747d4f7d9f4ea1 (diff) |
[mlir][NFC] Update the Builtin dialect to use "Both" accessors
Differential Revision: https://reviews.llvm.org/D121189
Diffstat (limited to 'flang')
-rw-r--r-- | flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp index 4c2ff9ab0916..a32dbee766f6 100644 --- a/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp +++ b/flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp @@ -67,12 +67,9 @@ public: matchAndRewrite(mlir::FuncOp op, mlir::PatternRewriter &rewriter) const override { rewriter.startRootUpdate(op); - auto result = fir::NameUniquer::deconstruct(op.sym_name()); - if (fir::NameUniquer::isExternalFacingUniquedName(result)) { - auto newName = mangleExternalName(result); - op.sym_nameAttr(rewriter.getStringAttr(newName)); - SymbolTable::setSymbolName(op, newName); - } + auto result = fir::NameUniquer::deconstruct(op.getSymName()); + if (fir::NameUniquer::isExternalFacingUniquedName(result)) + op.setSymNameAttr(rewriter.getStringAttr(mangleExternalName(result))); rewriter.finalizeRootUpdate(op); return success(); } @@ -165,7 +162,7 @@ void ExternalNameConversionPass::runOnOperation() { }); target.addDynamicallyLegalOp<mlir::FuncOp>([](mlir::FuncOp op) { - return !fir::NameUniquer::needExternalNameMangling(op.sym_name()); + return !fir::NameUniquer::needExternalNameMangling(op.getSymName()); }); target.addDynamicallyLegalOp<fir::GlobalOp>([](fir::GlobalOp op) { |