Skip to content

Commit cc392bb

Browse files
committed
Allow address spaces to propagate to LLVM
1 parent fab7455 commit cc392bb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

crates/rustc_codegen_nvvm/src/builder.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,18 +1154,7 @@ impl<'ll, 'tcx, 'a> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11541154

11551155
impl<'ll> StaticBuilderMethods for Builder<'_, 'll, '_> {
11561156
fn get_static(&mut self, def_id: DefId) -> &'ll Value {
1157-
unsafe {
1158-
let mut g = self.cx.get_static(def_id);
1159-
let llty = self.val_ty(g);
1160-
let addrspace = AddressSpace(llvm::LLVMGetPointerAddressSpace(llty));
1161-
if addrspace != AddressSpace::DATA {
1162-
trace!("Remapping global address space of global {:?}", g);
1163-
let llty = llvm::LLVMGetElementType(llty);
1164-
let ty = self.type_ptr_to_ext(llty, AddressSpace::DATA);
1165-
g = llvm::LLVMBuildAddrSpaceCast(self.llbuilder, g, ty, unnamed());
1166-
}
1167-
g
1168-
}
1157+
unsafe { self.cx.get_static(def_id) }
11691158
}
11701159
}
11711160

0 commit comments

Comments
 (0)