Skip to content

Commit 0864be4

Browse files
committed
Rename callee to sym_name and revise checking if specified
1 parent f5d94d2 commit 0864be4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,9 @@ def EmitC_DeclareFuncOp : EmitC_Op<"declare_func", [
496496
}
497497
```
498498
}];
499-
let arguments = (ins FlatSymbolRefAttr:$callee);
499+
let arguments = (ins FlatSymbolRefAttr:$sym_name);
500500
let assemblyFormat = [{
501-
$callee attr-dict
501+
$sym_name attr-dict
502502
}];
503503
}
504504

mlir/lib/Dialect/EmitC/IR/EmitC.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ FunctionType CallOp::getCalleeType() {
399399

400400
LogicalResult
401401
DeclareFuncOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
402-
// Check that the callee attribute was specified.
403-
auto fnAttr = (*this)->getAttrOfType<FlatSymbolRefAttr>("callee");
402+
// Check that the sym_name attribute was specified.
403+
auto fnAttr = getSymNameAttr();
404404
if (!fnAttr)
405-
return emitOpError("requires a 'callee' symbol reference attribute");
405+
return emitOpError("requires a 'sym_name' symbol reference attribute");
406406
FuncOp fn = symbolTable.lookupNearestSymbolFrom<FuncOp>(*this, fnAttr);
407407
if (!fn)
408408
return emitOpError() << "'" << fnAttr.getValue()

mlir/lib/Target/Cpp/TranslateToCpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ static LogicalResult printOperation(CppEmitter &emitter,
946946
raw_indented_ostream &os = emitter.ostream();
947947

948948
auto functionOp = SymbolTable::lookupNearestSymbolFrom<emitc::FuncOp>(
949-
declareFuncOp, declareFuncOp.getCalleeAttr());
949+
declareFuncOp, declareFuncOp.getSymNameAttr());
950950

951951
if (!functionOp)
952952
return failure();

mlir/test/Dialect/EmitC/invalid_ops.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,5 +329,5 @@ emitc.declare_func @bar
329329

330330
// -----
331331

332-
// expected-error@+1 {{'emitc.declare_func' op requires attribute 'callee'}}
332+
// expected-error@+1 {{'emitc.declare_func' op requires attribute 'sym_name'}}
333333
"emitc.declare_func"() : () -> ()

0 commit comments

Comments
 (0)