Skip to content

Commit def44c5

Browse files
cg_llvm: inline check_store
1 parent 04303cf commit def44c5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
652652
flags: MemFlags,
653653
) -> &'ll Value {
654654
debug!("Store {:?} -> {:?} ({:?})", val, ptr, flags);
655-
let ptr = self.check_store(ptr);
655+
assert_eq!(self.cx.type_kind(self.cx.val_ty(ptr)), TypeKind::Pointer);
656656
unsafe {
657657
let store = llvm::LLVMBuildStore(self.llbuilder, val, ptr);
658658
let align =
@@ -682,7 +682,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
682682
size: Size,
683683
) {
684684
debug!("Store {:?} -> {:?}", val, ptr);
685-
let ptr = self.check_store(ptr);
685+
assert_eq!(self.cx.type_kind(self.cx.val_ty(ptr)), TypeKind::Pointer);
686686
unsafe {
687687
let store = llvm::LLVMRustBuildAtomicStore(
688688
self.llbuilder,
@@ -1382,14 +1382,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
13821382
ret.expect("LLVM does not have support for catchret")
13831383
}
13841384

1385-
fn check_store(&mut self, ptr: &'ll Value) -> &'ll Value {
1386-
let dest_ptr_ty = self.cx.val_ty(ptr);
1387-
1388-
assert_eq!(self.cx.type_kind(dest_ptr_ty), TypeKind::Pointer);
1389-
1390-
ptr
1391-
}
1392-
13931385
fn check_call<'b>(
13941386
&mut self,
13951387
typ: &str,

0 commit comments

Comments
 (0)