diff options
author | River Riddle <riverriddle@google.com> | 2019-07-01 10:29:09 -0700 |
---|---|---|
committer | jpienaar <jpienaar@google.com> | 2019-07-01 11:39:00 -0700 |
commit | 54cd6a7e97a226738e2c85b86559918dd9e3cd5d (patch) | |
tree | affa803347d6695be575137d1ad55a055a8021e3 /mlir/lib/ExecutionEngine/MemRefUtils.cpp | |
parent | 84bd67fc4fd116e80f7a66bfadfe9a7fd6fd5e82 (diff) | |
download | bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.tar.gz bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.zip |
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
Diffstat (limited to 'mlir/lib/ExecutionEngine/MemRefUtils.cpp')
-rw-r--r-- | mlir/lib/ExecutionEngine/MemRefUtils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mlir/lib/ExecutionEngine/MemRefUtils.cpp b/mlir/lib/ExecutionEngine/MemRefUtils.cpp index 51636037382..f13b743de0c 100644 --- a/mlir/lib/ExecutionEngine/MemRefUtils.cpp +++ b/mlir/lib/ExecutionEngine/MemRefUtils.cpp @@ -67,10 +67,10 @@ allocMemRefDescriptor(Type type, bool allocateData = true, } llvm::Expected<SmallVector<void *, 8>> -mlir::allocateMemRefArguments(Function *func, float initialValue) { +mlir::allocateMemRefArguments(Function func, float initialValue) { SmallVector<void *, 8> args; - args.reserve(func->getNumArguments()); - for (const auto &arg : func->getArguments()) { + args.reserve(func.getNumArguments()); + for (const auto &arg : func.getArguments()) { auto descriptor = allocMemRefDescriptor(arg->getType(), /*allocateData=*/true, initialValue); @@ -79,10 +79,10 @@ mlir::allocateMemRefArguments(Function *func, float initialValue) { args.push_back(*descriptor); } - if (func->getType().getNumResults() > 1) + if (func.getType().getNumResults() > 1) return make_string_error("functions with more than 1 result not supported"); - for (Type resType : func->getType().getResults()) { + for (Type resType : func.getType().getResults()) { auto descriptor = allocMemRefDescriptor(resType, /*allocateData=*/false); if (!descriptor) return descriptor.takeError(); |