diff options
author | River Riddle <riverriddle@google.com> | 2019-12-22 21:59:55 -0800 |
---|---|---|
committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-22 22:00:23 -0800 |
commit | 35807bc4c5c9d8abc31ba0b2f955a82abf276e12 (patch) | |
tree | d083d37d993a774239081509a50e3e6c65366421 /mlir/test/lib/TestDialect/TestDialect.cpp | |
parent | 22954a0e408afde1d8686dffb3a3dcab107a2cd3 (diff) | |
download | bcm5719-llvm-35807bc4c5c9d8abc31ba0b2f955a82abf276e12.tar.gz bcm5719-llvm-35807bc4c5c9d8abc31ba0b2f955a82abf276e12.zip |
NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to Value being value-typed.
This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ
This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics.
PiperOrigin-RevId: 286844725
Diffstat (limited to 'mlir/test/lib/TestDialect/TestDialect.cpp')
-rw-r--r-- | mlir/test/lib/TestDialect/TestDialect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mlir/test/lib/TestDialect/TestDialect.cpp b/mlir/test/lib/TestDialect/TestDialect.cpp index 7462db4544f..12d024f6593 100644 --- a/mlir/test/lib/TestDialect/TestDialect.cpp +++ b/mlir/test/lib/TestDialect/TestDialect.cpp @@ -100,7 +100,7 @@ struct TestInlinerInterface : public DialectInlinerInterface { /// Handle the given inlined terminator by replacing it with a new operation /// as necessary. void handleTerminator(Operation *op, - ArrayRef<Value *> valuesToRepl) const final { + ArrayRef<ValuePtr> valuesToRepl) const final { // Only handle "test.return" here. auto returnOp = dyn_cast<TestReturnOp>(op); if (!returnOp) @@ -117,7 +117,7 @@ struct TestInlinerInterface : public DialectInlinerInterface { /// operation that takes 'input' as the only operand, and produces a single /// result of 'resultType'. If a conversion can not be generated, nullptr /// should be returned. - Operation *materializeCallConversion(OpBuilder &builder, Value *input, + Operation *materializeCallConversion(OpBuilder &builder, ValuePtr input, Type resultType, Location conversionLoc) const final { // Only allow conversion for i16/i32 types. @@ -231,7 +231,7 @@ static ParseResult parseWrappingRegionOp(OpAsmParser &parser, // Create a return terminator in the inner region, pass as operand to the // terminator the returned values from the wrapped operation. - SmallVector<Value *, 8> return_operands(wrapped_op->getResults()); + SmallVector<ValuePtr, 8> return_operands(wrapped_op->getResults()); OpBuilder builder(parser.getBuilder().getContext()); builder.setInsertionPointToEnd(&block); builder.create<TestReturnOp>(wrapped_op->getLoc(), return_operands); @@ -297,7 +297,7 @@ OpFoldResult TestOpWithRegionFold::fold(ArrayRef<Attribute> operands) { LogicalResult TestOpWithVariadicResultsAndFolder::fold( ArrayRef<Attribute> operands, SmallVectorImpl<OpFoldResult> &results) { - for (Value *input : this->operands()) { + for (ValuePtr input : this->operands()) { results.push_back(input); } return success(); |