Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed May 10, 2024
1 parent ea228dc commit a849920
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/concrete_codegen_mlir/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ fn compile_rvalue<'c: 'b, 'b>(
} else if current_ty.kind.is_ptr_like() {
(value, target_ty.clone())
} else if current_ty.kind.is_array() {
// Cast from fixed size array to pointer.
// We need to create a alloca and store the array there, because we have it by-value.
let k1 = block
.append_operation(arith::constant(
ctx.context(),
Expand All @@ -553,6 +555,8 @@ fn compile_rvalue<'c: 'b, 'b>(
ods::llvm::store(ctx.context(), value, ptr, location).into(),
);

// Return the alloca ptr, making this "the cast".

(ptr, target_ty.clone())
} else {
unreachable!("cast from {:?} to ptr", current_ty.kind)
Expand Down

0 comments on commit a849920

Please sign in to comment.