]> git.lizzy.rs Git - rust.git/commitdiff
remove unused functions from trans and llvm
authorOliver Schneider <git1984941651981@oli-obk.de>
Thu, 18 Jun 2015 11:23:41 +0000 (13:23 +0200)
committerOliver Schneider <git1984941651981@oli-obk.de>
Thu, 18 Jun 2015 11:23:41 +0000 (13:23 +0200)
src/librustc_llvm/lib.rs
src/librustc_trans/trans/build.rs
src/librustc_trans/trans/builder.rs

index bf331705b32c92480bf0f43b291b8efd6ab655d3..5a4a6c5b9c0f32f032098fa5692ef940f25a2157 100644 (file)
@@ -1300,20 +1300,8 @@ pub fn LLVMBuildNot(B: BuilderRef, V: ValueRef, Name: *const c_char)
                         -> ValueRef;
 
     /* Memory */
-    pub fn LLVMBuildMalloc(B: BuilderRef, Ty: TypeRef, Name: *const c_char)
-                           -> ValueRef;
-    pub fn LLVMBuildArrayMalloc(B: BuilderRef,
-                                Ty: TypeRef,
-                                Val: ValueRef,
-                                Name: *const c_char)
-                                -> ValueRef;
     pub fn LLVMBuildAlloca(B: BuilderRef, Ty: TypeRef, Name: *const c_char)
                            -> ValueRef;
-    pub fn LLVMBuildArrayAlloca(B: BuilderRef,
-                                Ty: TypeRef,
-                                Val: ValueRef,
-                                Name: *const c_char)
-                                -> ValueRef;
     pub fn LLVMBuildFree(B: BuilderRef, PointerVal: ValueRef) -> ValueRef;
     pub fn LLVMBuildLoad(B: BuilderRef,
                          PointerVal: ValueRef,
index d6ac412a4faead9678cc7711671e87e40a1e78df..05d0a967e64b6e13d76e2ea50153b7a17fe46d80 100644 (file)
@@ -522,30 +522,6 @@ pub fn Not(cx: Block, v: ValueRef, debug_loc: DebugLoc) -> ValueRef {
     B(cx).not(v)
 }
 
-/* Memory */
-pub fn Malloc(cx: Block, ty: Type, debug_loc: DebugLoc) -> ValueRef {
-    unsafe {
-        if cx.unreachable.get() {
-            return llvm::LLVMGetUndef(Type::i8p(cx.ccx()).to_ref());
-        }
-        debug_loc.apply(cx.fcx);
-        B(cx).malloc(ty)
-    }
-}
-
-pub fn ArrayMalloc(cx: Block,
-                   ty: Type,
-                   val: ValueRef,
-                   debug_loc: DebugLoc) -> ValueRef {
-    unsafe {
-        if cx.unreachable.get() {
-            return llvm::LLVMGetUndef(Type::i8p(cx.ccx()).to_ref());
-        }
-        debug_loc.apply(cx.fcx);
-        B(cx).array_malloc(ty, val)
-    }
-}
-
 pub fn Alloca(cx: Block, ty: Type, name: &str) -> ValueRef {
     unsafe {
         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 {
     b.alloca(ty, name)
 }
 
-pub fn ArrayAlloca(cx: Block, ty: Type, val: ValueRef) -> ValueRef {
-    unsafe {
-        if cx.unreachable.get() { return llvm::LLVMGetUndef(ty.ptr_to().to_ref()); }
-        let b = cx.fcx.ccx.builder();
-        b.position_before(cx.fcx.alloca_insert_pt.get().unwrap());
-        DebugLoc::None.apply(cx.fcx);
-        b.array_alloca(ty, val)
-    }
-}
-
 pub fn Free(cx: Block, pointer_val: ValueRef) {
     if cx.unreachable.get() { return; }
     B(cx).free(pointer_val)
index 947f45dc3918239b2f648a2c278755bf886c7345..e100defc248755c0155544783d01f21cc52051dc 100644 (file)
@@ -410,21 +410,6 @@ pub fn not(&self, v: ValueRef) -> ValueRef {
         }
     }
 
-    /* Memory */
-    pub fn malloc(&self, ty: Type) -> ValueRef {
-        self.count_insn("malloc");
-        unsafe {
-            llvm::LLVMBuildMalloc(self.llbuilder, ty.to_ref(), noname())
-        }
-    }
-
-    pub fn array_malloc(&self, ty: Type, val: ValueRef) -> ValueRef {
-        self.count_insn("arraymalloc");
-        unsafe {
-            llvm::LLVMBuildArrayMalloc(self.llbuilder, ty.to_ref(), val, noname())
-        }
-    }
-
     pub fn alloca(&self, ty: Type, name: &str) -> ValueRef {
         self.count_insn("alloca");
         unsafe {
@@ -438,13 +423,6 @@ pub fn alloca(&self, ty: Type, name: &str) -> ValueRef {
         }
     }
 
-    pub fn array_alloca(&self, ty: Type, val: ValueRef) -> ValueRef {
-        self.count_insn("arrayalloca");
-        unsafe {
-            llvm::LLVMBuildArrayAlloca(self.llbuilder, ty.to_ref(), val, noname())
-        }
-    }
-
     pub fn free(&self, ptr: ValueRef) {
         self.count_insn("free");
         unsafe {