Skip to content

Commit

Permalink
[ReuseIR] adjust clone
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingerZhu committed Sep 18, 2024
1 parent aabbd69 commit 46fd76e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions reuse-mlir/include/ReuseIR/IR/ReuseIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,15 @@ def CloneOp : ReuseIR_Op<"clone"> {
it will increase the reference count of sub fields if necessary.
}];

// TODO: Add type restrictions
let arguments = (ins
Arg<ReuseIR_RefType, "clonable object", [MemRead, MemAlloc<DefaultResource>]>:$object,
Arg<ReuseIR_RefType, "clonable object">:$object,
OptionalAttr<IndexAttr>:$tag
);

let results = (outs Res<AnyType, "Cloned Object">:$result);

let assemblyFormat = [{
`(` $object `:` type($object) `)` (`tag` `(` $tag^ `)`)? attr-dict
`(` $object `:` type($object) `)` (`tag` `(` $tag^ `)`)? attr-dict `:` type($result)
}];
}

Expand Down

0 comments on commit 46fd76e

Please sign in to comment.