Skip to content

Commit 268e02c

Browse files
committed
Remove type argument of array_alloca and rename to byte_array_alloca
1 parent 0fe84bc commit 268e02c

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
655655
self.current_func().new_local(None, aligned_type, &format!("stack_var_{}", self.stack_var_count.get())).get_address(None)
656656
}
657657

658-
fn array_alloca(&mut self, _ty: Type<'gcc>, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
658+
fn byte_array_alloca(&mut self, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
659659
unimplemented!();
660660
}
661661

compiler/rustc_codegen_llvm/src/builder.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,10 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
418418
}
419419
}
420420

421-
fn array_alloca(&mut self, ty: &'ll Type, len: &'ll Value, align: Align) -> &'ll Value {
421+
fn byte_array_alloca(&mut self, len: &'ll Value, align: Align) -> &'ll Value {
422422
unsafe {
423-
let alloca = llvm::LLVMBuildArrayAlloca(self.llbuilder, ty, len, UNNAMED);
423+
let alloca =
424+
llvm::LLVMBuildArrayAlloca(self.llbuilder, self.cx().type_i8(), len, UNNAMED);
424425
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
425426
alloca
426427
}

compiler/rustc_codegen_ssa/src/mir/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
352352

353353
// Allocate an appropriate region on the stack, and copy the value into it
354354
let (llsize, _) = glue::size_and_align_of_dst(bx, unsized_ty, Some(llextra));
355-
let lldst = bx.array_alloca(bx.cx().type_i8(), llsize, max_align);
355+
let lldst = bx.byte_array_alloca(llsize, max_align);
356356
bx.memcpy(lldst, max_align, llptr, min_align, llsize, flags);
357357

358358
// Store the allocated region and the extra to the indirect place.

compiler/rustc_codegen_ssa/src/traits/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub trait BuilderMethods<'a, 'tcx>:
135135
fn to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value;
136136

137137
fn alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value;
138-
fn array_alloca(&mut self, ty: Self::Type, len: Self::Value, align: Align) -> Self::Value;
138+
fn byte_array_alloca(&mut self, len: Self::Value, align: Align) -> Self::Value;
139139

140140
fn load(&mut self, ty: Self::Type, ptr: Self::Value, align: Align) -> Self::Value;
141141
fn volatile_load(&mut self, ty: Self::Type, ptr: Self::Value) -> Self::Value;

0 commit comments

Comments
 (0)