Skip to content

Commit 36baa97

Browse files
committed
Rename static_bitcast to const_bitcast
1 parent 01fad77 commit 36baa97

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc_codegen_llvm/common.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
312312
if layout.value == layout::Pointer {
313313
unsafe { llvm::LLVMConstIntToPtr(llval, llty) }
314314
} else {
315-
self.static_bitcast(llval, llty)
315+
self.const_bitcast(llval, llty)
316316
}
317317
},
318318
Scalar::Ptr(ptr) => {
@@ -336,14 +336,14 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
336336
None => bug!("missing allocation {:?}", ptr.alloc_id),
337337
};
338338
let llval = unsafe { llvm::LLVMConstInBoundsGEP(
339-
self.static_bitcast(base_addr, self.type_i8p()),
339+
self.const_bitcast(base_addr, self.type_i8p()),
340340
&self.const_usize(ptr.offset.bytes()),
341341
1,
342342
) };
343343
if layout.value != layout::Pointer {
344344
unsafe { llvm::LLVMConstPtrToInt(llval, llty) }
345345
} else {
346-
self.static_bitcast(llval, llty)
346+
self.const_bitcast(llval, llty)
347347
}
348348
}
349349
}
@@ -359,11 +359,11 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
359359
let base_addr = self.static_addr_of(init, layout.align.abi, None);
360360

361361
let llval = unsafe { llvm::LLVMConstInBoundsGEP(
362-
self.static_bitcast(base_addr, self.type_i8p()),
362+
self.const_bitcast(base_addr, self.type_i8p()),
363363
&self.const_usize(offset.bytes()),
364364
1,
365365
)};
366-
let llval = self.static_bitcast(llval, self.type_ptr_to(layout.llvm_type(self)));
366+
let llval = self.const_bitcast(llval, self.type_ptr_to(layout.llvm_type(self)));
367367
PlaceRef::new_sized(llval, layout, alloc.align)
368368
}
369369

src/librustc_codegen_llvm/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub fn ptrcast(val: &'ll Value, ty: &'ll Type) -> &'ll Value {
172172
}
173173

174174
impl CodegenCx<'ll, 'tcx> {
175-
crate fn static_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value {
175+
crate fn const_bitcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value {
176176
unsafe {
177177
llvm::LLVMConstBitCast(val, ty)
178178
}

0 commit comments

Comments
 (0)