Skip to content

Commit 2d4dc1c

Browse files
committed
[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
1 parent b861ddf commit 2d4dc1c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

flang/lib/Optimizer/Dialect/FIROps.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ static void printCallOp(mlir::OpAsmPrinter &p, fir::CallOp &op) {
603603
else
604604
p << op.getOperand(0);
605605
p << '(' << op->getOperands().drop_front(isDirect ? 0 : 1) << ')';
606-
p.printOptionalAttrDict(op->getAttrs(), {"callee"});
606+
p.printOptionalAttrDict(op->getAttrs(),
607+
{fir::CallOp::getCalleeAttrNameStr()});
607608
auto resultTypes{op.getResultTypes()};
608609
llvm::SmallVector<Type> argTypes(
609610
llvm::drop_begin(op.getOperandTypes(), isDirect ? 0 : 1));
@@ -620,7 +621,8 @@ static mlir::ParseResult parseCallOp(mlir::OpAsmParser &parser,
620621
mlir::SymbolRefAttr funcAttr;
621622
bool isDirect = operands.empty();
622623
if (isDirect)
623-
if (parser.parseAttribute(funcAttr, "callee", attrs))
624+
if (parser.parseAttribute(funcAttr, fir::CallOp::getCalleeAttrNameStr(),
625+
attrs))
624626
return mlir::failure();
625627

626628
Type type;

0 commit comments

Comments
 (0)