Skip to content

Commit 7a13b93

Browse files
committed
Auto merge of #26392 - oli-obk:unused_functions, r=dotdash
These aren't used anywhere and to my current knowledge it's unlikely that they are going to be used in the future
2 parents 1ef14d9 + 59638d1 commit 7a13b93

File tree

3 files changed

+0
-68
lines changed

3 files changed

+0
-68
lines changed

src/librustc_llvm/lib.rs

-12
Original file line numberDiff line numberDiff line change
@@ -1300,20 +1300,8 @@ extern {
13001300
-> ValueRef;
13011301

13021302
/* Memory */
1303-
pub fn LLVMBuildMalloc(B: BuilderRef, Ty: TypeRef, Name: *const c_char)
1304-
-> ValueRef;
1305-
pub fn LLVMBuildArrayMalloc(B: BuilderRef,
1306-
Ty: TypeRef,
1307-
Val: ValueRef,
1308-
Name: *const c_char)
1309-
-> ValueRef;
13101303
pub fn LLVMBuildAlloca(B: BuilderRef, Ty: TypeRef, Name: *const c_char)
13111304
-> ValueRef;
1312-
pub fn LLVMBuildArrayAlloca(B: BuilderRef,
1313-
Ty: TypeRef,
1314-
Val: ValueRef,
1315-
Name: *const c_char)
1316-
-> ValueRef;
13171305
pub fn LLVMBuildFree(B: BuilderRef, PointerVal: ValueRef) -> ValueRef;
13181306
pub fn LLVMBuildLoad(B: BuilderRef,
13191307
PointerVal: ValueRef,

src/librustc_trans/trans/build.rs

-34
Original file line numberDiff line numberDiff line change
@@ -522,30 +522,6 @@ pub fn Not(cx: Block, v: ValueRef, debug_loc: DebugLoc) -> ValueRef {
522522
B(cx).not(v)
523523
}
524524

525-
/* Memory */
526-
pub fn Malloc(cx: Block, ty: Type, debug_loc: DebugLoc) -> ValueRef {
527-
unsafe {
528-
if cx.unreachable.get() {
529-
return llvm::LLVMGetUndef(Type::i8p(cx.ccx()).to_ref());
530-
}
531-
debug_loc.apply(cx.fcx);
532-
B(cx).malloc(ty)
533-
}
534-
}
535-
536-
pub fn ArrayMalloc(cx: Block,
537-
ty: Type,
538-
val: ValueRef,
539-
debug_loc: DebugLoc) -> ValueRef {
540-
unsafe {
541-
if cx.unreachable.get() {
542-
return llvm::LLVMGetUndef(Type::i8p(cx.ccx()).to_ref());
543-
}
544-
debug_loc.apply(cx.fcx);
545-
B(cx).array_malloc(ty, val)
546-
}
547-
}
548-
549525
pub fn Alloca(cx: Block, ty: Type, name: &str) -> ValueRef {
550526
unsafe {
551527
if cx.unreachable.get() { return llvm::LLVMGetUndef(ty.ptr_to().to_ref()); }
@@ -560,16 +536,6 @@ pub fn AllocaFcx(fcx: &FunctionContext, ty: Type, name: &str) -> ValueRef {
560536
b.alloca(ty, name)
561537
}
562538

563-
pub fn ArrayAlloca(cx: Block, ty: Type, val: ValueRef) -> ValueRef {
564-
unsafe {
565-
if cx.unreachable.get() { return llvm::LLVMGetUndef(ty.ptr_to().to_ref()); }
566-
let b = cx.fcx.ccx.builder();
567-
b.position_before(cx.fcx.alloca_insert_pt.get().unwrap());
568-
DebugLoc::None.apply(cx.fcx);
569-
b.array_alloca(ty, val)
570-
}
571-
}
572-
573539
pub fn Free(cx: Block, pointer_val: ValueRef) {
574540
if cx.unreachable.get() { return; }
575541
B(cx).free(pointer_val)

src/librustc_trans/trans/builder.rs

-22
Original file line numberDiff line numberDiff line change
@@ -410,21 +410,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
410410
}
411411
}
412412

413-
/* Memory */
414-
pub fn malloc(&self, ty: Type) -> ValueRef {
415-
self.count_insn("malloc");
416-
unsafe {
417-
llvm::LLVMBuildMalloc(self.llbuilder, ty.to_ref(), noname())
418-
}
419-
}
420-
421-
pub fn array_malloc(&self, ty: Type, val: ValueRef) -> ValueRef {
422-
self.count_insn("arraymalloc");
423-
unsafe {
424-
llvm::LLVMBuildArrayMalloc(self.llbuilder, ty.to_ref(), val, noname())
425-
}
426-
}
427-
428413
pub fn alloca(&self, ty: Type, name: &str) -> ValueRef {
429414
self.count_insn("alloca");
430415
unsafe {
@@ -438,13 +423,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
438423
}
439424
}
440425

441-
pub fn array_alloca(&self, ty: Type, val: ValueRef) -> ValueRef {
442-
self.count_insn("arrayalloca");
443-
unsafe {
444-
llvm::LLVMBuildArrayAlloca(self.llbuilder, ty.to_ref(), val, noname())
445-
}
446-
}
447-
448426
pub fn free(&self, ptr: ValueRef) {
449427
self.count_insn("free");
450428
unsafe {

0 commit comments

Comments
 (0)