From f47505e86740223e0cd3516683fa2a4013cf89aa Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 24 Nov 2018 17:45:05 +0100 Subject: [PATCH] Rename static_bitcast to const_bitcast --- src/librustc_codegen_llvm/common.rs | 10 +++++----- src/librustc_codegen_llvm/consts.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_codegen_llvm/common.rs b/src/librustc_codegen_llvm/common.rs index f9850a08afec..fd13421835c1 100644 --- a/src/librustc_codegen_llvm/common.rs +++ b/src/librustc_codegen_llvm/common.rs @@ -312,7 +312,7 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { if layout.value == layout::Pointer { unsafe { llvm::LLVMConstIntToPtr(llval, llty) } } else { - self.static_bitcast(llval, llty) + self.const_bitcast(llval, llty) } }, Scalar::Ptr(ptr) => { @@ -336,14 +336,14 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { None => bug!("missing allocation {:?}", ptr.alloc_id), }; let llval = unsafe { llvm::LLVMConstInBoundsGEP( - self.static_bitcast(base_addr, self.type_i8p()), + self.const_bitcast(base_addr, self.type_i8p()), &self.const_usize(ptr.offset.bytes()), 1, ) }; if layout.value != layout::Pointer { unsafe { llvm::LLVMConstPtrToInt(llval, llty) } } else { - self.static_bitcast(llval, llty) + self.const_bitcast(llval, llty) } } } @@ -359,11 +359,11 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { let base_addr = self.static_addr_of(init, layout.align.abi, None); let llval = unsafe { llvm::LLVMConstInBoundsGEP( - self.static_bitcast(base_addr, self.type_i8p()), + self.const_bitcast(base_addr, self.type_i8p()), &self.const_usize(offset.bytes()), 1, )}; - let llval = self.static_bitcast(llval, self.type_ptr_to(layout.llvm_type(self))); + let llval = self.const_bitcast(llval, self.type_ptr_to(layout.llvm_type(self))); PlaceRef::new_sized(llval, layout, alloc.align) } diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs index 676d182dbac9..576a49a13ddb 100644 --- a/src/librustc_codegen_llvm/consts.rs +++ b/src/librustc_codegen_llvm/consts.rs @@ -172,7 +172,7 @@ pub fn ptrcast(val: &'ll Value, ty: &'ll Type) -> &'ll Value { } impl CodegenCx<'ll, 'tcx> { - crate fn static_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value { + crate fn const_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value { unsafe { llvm::LLVMConstBitCast(val, ty) }