Skip to content

Commit 0fe84bc

Browse files
committed
Remove dynamic_alloca from BuilderMethods
1 parent 62cf644 commit 0fe84bc

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

-4
Original file line numberDiff line numberDiff line change
@@ -655,10 +655,6 @@ 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 dynamic_alloca(&mut self, _ty: Type<'gcc>, _align: Align) -> RValue<'gcc> {
659-
unimplemented!();
660-
}
661-
662658
fn array_alloca(&mut self, _ty: Type<'gcc>, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
663659
unimplemented!();
664660
}

compiler/rustc_codegen_llvm/src/builder.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,8 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
411411
fn alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value {
412412
let mut bx = Builder::with_cx(self.cx);
413413
bx.position_at_start(unsafe { llvm::LLVMGetFirstBasicBlock(self.llfn()) });
414-
bx.dynamic_alloca(ty, align)
415-
}
416-
417-
fn dynamic_alloca(&mut self, ty: &'ll Type, align: Align) -> &'ll Value {
418414
unsafe {
419-
let alloca = llvm::LLVMBuildAlloca(self.llbuilder, ty, UNNAMED);
415+
let alloca = llvm::LLVMBuildAlloca(bx.llbuilder, ty, UNNAMED);
420416
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
421417
alloca
422418
}

compiler/rustc_codegen_ssa/src/traits/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ 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 dynamic_alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value;
139138
fn array_alloca(&mut self, ty: Self::Type, len: Self::Value, align: Align) -> Self::Value;
140139

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

0 commit comments

Comments
 (0)