Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Oct 14, 2023
1 parent a6a6c77 commit 32150cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions macro/src/dialect/operation/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'o> OperationBuilder<'o> {
#[doc = #doc]
pub struct #builder_ident <'c, #(#iter_arguments),* > {
builder: ::melior::ir::operation::OperationBuilder<'c>,
context: ::melior::ContextRef<'c>,
context: &'c ::melior::Context,
#(#phantom_fields),*
}

Expand Down Expand Up @@ -180,9 +180,9 @@ impl<'o> OperationBuilder<'o> {

quote! {
impl<'c> #builder_ident<'c, #(#arguments),*> {
pub fn new(location: ::melior::ir::Location<'c>) -> Self {
pub fn new(context: &'c ::melior::Context, location: ::melior::ir::Location<'c>) -> Self {
Self {
context: location.context(),
context,
builder: ::melior::ir::operation::OperationBuilder::new(&context, #name, location),
#(#phantoms),*
}
Expand Down
2 changes: 1 addition & 1 deletion melior/src/dialect/ods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ mod tests {
let i64_type = IntegerType::new(&context, 64);

block.append_operation(
llvm::AllocaOpBuilder::new(location)
llvm::AllocaOpBuilder::new(&context, location)
.alignment(IntegerAttribute::new(8, i64_type.into()))
.elem_type(TypeAttribute::new(i64_type.into()))
.array_size(alloca_size)
Expand Down

0 comments on commit 32150cb

Please sign in to comment.