forked from OSchip/llvm-project
[mlir] Fix unused function warning (NFC)
Delete function no longer needed as all derived classes override printer.
This commit is contained in:
parent
6f9cceb775
commit
e5a4d0f149
|
@ -82,10 +82,6 @@ class ArithmeticOp<string mnemonic, list<OpTrait> traits = []> :
|
|||
let parser = [{
|
||||
return impl::parseOneResultSameOperandTypeOp(parser, result);
|
||||
}];
|
||||
|
||||
let printer = [{
|
||||
return printStandardBinaryOp(this->getOperation(), p);
|
||||
}];
|
||||
}
|
||||
|
||||
// Base class for standard binary arithmetic operations.
|
||||
|
@ -95,10 +91,6 @@ class ArithmeticBinaryOp<string mnemonic, list<OpTrait> traits = []> :
|
|||
let parser = [{
|
||||
return impl::parseOneResultSameOperandTypeOp(parser, result);
|
||||
}];
|
||||
|
||||
let printer = [{
|
||||
return printStandardBinaryOp(this->getOperation(), p);
|
||||
}];
|
||||
}
|
||||
|
||||
// Base class for standard ternary arithmetic operations.
|
||||
|
|
|
@ -100,28 +100,6 @@ struct StdInlinerInterface : public DialectInlinerInterface {
|
|||
// StandardOpsDialect
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// A custom binary operation printer that omits the "std." prefix from the
|
||||
/// operation names.
|
||||
static void printStandardBinaryOp(Operation *op, OpAsmPrinter &p) {
|
||||
assert(op->getNumOperands() == 2 && "binary op should have two operands");
|
||||
assert(op->getNumResults() == 1 && "binary op should have one result");
|
||||
|
||||
// If not all the operand and result types are the same, just use the
|
||||
// generic assembly form to avoid omitting information in printing.
|
||||
auto resultType = op->getResult(0).getType();
|
||||
if (op->getOperand(0).getType() != resultType ||
|
||||
op->getOperand(1).getType() != resultType) {
|
||||
p.printGenericOp(op);
|
||||
return;
|
||||
}
|
||||
|
||||
p << ' ' << op->getOperand(0) << ", " << op->getOperand(1);
|
||||
p.printOptionalAttrDict(op->getAttrs());
|
||||
|
||||
// Now we can output only one type for all operands and the result.
|
||||
p << " : " << op->getResult(0).getType();
|
||||
}
|
||||
|
||||
void StandardOpsDialect::initialize() {
|
||||
addOperations<
|
||||
#define GET_OP_LIST
|
||||
|
|
Loading…
Reference in New Issue