Skip to content

Commit

Permalink
add constructor for MModule from module operation
Browse files Browse the repository at this point in the history
This enables creating modules with attributes such as:
```
module attributes {transform.with_named_sequence} { ... }
```
  • Loading branch information
jumerckx authored Jan 23, 2024
1 parent 3a43434 commit 2ed0c7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/IR/IR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ end

MModule(loc::Location=Location()) =
MModule(API.mlirModuleCreateEmpty(loc))
MModule(op::Operation) = MModule(API.mlirModuleFromOperation(op))
get_operation(module_) = Operation(API.mlirModuleGetOperation(module_), false)
get_body(module_) = Block(API.mlirModuleGetBody(module_), false)
get_first_child_op(mod::MModule) = get_first_child_op(get_operation(mod))
Expand Down

0 comments on commit 2ed0c7b

Please sign in to comment.