From 54cd6a7e97a226738e2c85b86559918dd9e3cd5d Mon Sep 17 00:00:00 2001 From: River Riddle Date: Mon, 1 Jul 2019 10:29:09 -0700 Subject: NFC: Refactor Function to be value typed. Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed). PiperOrigin-RevId: 255983022 --- mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp') diff --git a/mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp b/mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp index 3add211fdd5..543b7300af0 100644 --- a/mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp +++ b/mlir/lib/SPIRV/Serialization/ConvertFromBinary.cpp @@ -36,11 +36,11 @@ using namespace mlir; // block. The created block will be terminated by `std.return`. Block *createOneBlockFunction(Builder builder, Module *module) { auto fnType = builder.getFunctionType(/*inputs=*/{}, /*results=*/{}); - auto *fn = new Function(builder.getUnknownLoc(), "spirv_module", fnType); - module->getFunctions().push_back(fn); + auto fn = Function::create(builder.getUnknownLoc(), "spirv_module", fnType); + module->push_back(fn); auto *block = new Block(); - fn->push_back(block); + fn.push_back(block); OperationState state(builder.getUnknownLoc(), ReturnOp::getOperationName()); ReturnOp::build(&builder, &state); -- cgit v1.2.3