[flang-commits] [flang] 2d4dc1c - [flang][NFC] Replace hardcoded attribute name
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Thu Feb 10 09:34:17 PST 2022
Author: Valentin Clement
Date: 2022-02-10T18:34:12+01:00
New Revision: 2d4dc1cba0a75b29b1a46244ad3e180a2df31e09
URL: https://github.com/llvm/llvm-project/commit/2d4dc1cba0a75b29b1a46244ad3e180a2df31e09
DIFF: https://github.com/llvm/llvm-project/commit/2d4dc1cba0a75b29b1a46244ad3e180a2df31e09.diff
LOG: [flang][NFC] Replace hardcoded attribute name
Replace the hardcoded attribute name with the constexpr StringRef
defined in the FIROps.td file.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D119422
Added:
Modified:
flang/lib/Optimizer/Dialect/FIROps.cpp
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 33d34b6ad51a8..3c3a6646aa4c3 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -603,7 +603,8 @@ static void printCallOp(mlir::OpAsmPrinter &p, fir::CallOp &op) {
else
p << op.getOperand(0);
p << '(' << op->getOperands().drop_front(isDirect ? 0 : 1) << ')';
- p.printOptionalAttrDict(op->getAttrs(), {"callee"});
+ p.printOptionalAttrDict(op->getAttrs(),
+ {fir::CallOp::getCalleeAttrNameStr()});
auto resultTypes{op.getResultTypes()};
llvm::SmallVector<Type> argTypes(
llvm::drop_begin(op.getOperandTypes(), isDirect ? 0 : 1));
@@ -620,7 +621,8 @@ static mlir::ParseResult parseCallOp(mlir::OpAsmParser &parser,
mlir::SymbolRefAttr funcAttr;
bool isDirect = operands.empty();
if (isDirect)
- if (parser.parseAttribute(funcAttr, "callee", attrs))
+ if (parser.parseAttribute(funcAttr, fir::CallOp::getCalleeAttrNameStr(),
+ attrs))
return mlir::failure();
Type type;
More information about the flang-commits
mailing list