Skip to content

Commit bfdcb05

Browse files
committed
push for other pc
1 parent 068f182 commit bfdcb05

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

crates/rustc_codegen_nvvm/src/const_ty.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -209,32 +209,32 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
209209
}
210210
}
211211

212-
fn from_const_alloc(
213-
&self,
214-
layout: TyAndLayout<'tcx>,
215-
alloc: ConstAllocation<'tcx>,
216-
offset: Size,
217-
) -> PlaceRef<'tcx, &'ll Value> {
218-
assert_eq!(alloc.0 .0.align, layout.align.abi);
219-
let llty = self.type_ptr_to(layout.llvm_type(self));
220-
let llval = if layout.size == Size::ZERO {
221-
let llval = self.const_usize(alloc.0 .0.align.bytes());
222-
unsafe { llvm::LLVMConstIntToPtr(llval, llty) }
223-
} else {
224-
let init = const_alloc_to_llvm(self, &alloc);
225-
let base_addr = self.static_addr_of(init, alloc.0 .0.align, None);
226-
227-
let llval = unsafe {
228-
llvm::LLVMConstInBoundsGEP(
229-
self.const_bitcast(base_addr, self.type_i8p()),
230-
&self.const_usize(offset.bytes()),
231-
1,
232-
)
233-
};
234-
self.const_bitcast(llval, llty)
235-
};
236-
PlaceRef::new_sized(llval, layout)
237-
}
212+
// fn from_const_alloc(
213+
// &self,
214+
// layout: TyAndLayout<'tcx>,
215+
// alloc: ConstAllocation<'tcx>,
216+
// offset: Size,
217+
// ) -> PlaceRef<'tcx, &'ll Value> {
218+
// assert_eq!(alloc.0 .0.align, layout.align.abi);
219+
// let llty = self.type_ptr_to(layout.llvm_type(self));
220+
// let llval = if layout.size == Size::ZERO {
221+
// let llval = self.const_usize(alloc.0 .0.align.bytes());
222+
// unsafe { llvm::LLVMConstIntToPtr(llval, llty) }
223+
// } else {
224+
// let init = const_alloc_to_llvm(self, &alloc);
225+
// let base_addr = self.static_addr_of(init, alloc.0 .0.align, None);
226+
//
227+
// let llval = unsafe {
228+
// llvm::LLVMConstInBoundsGEP(
229+
// self.const_bitcast(base_addr, self.type_i8p()),
230+
// &self.const_usize(offset.bytes()),
231+
// 1,
232+
// )
233+
// };
234+
// self.const_bitcast(llval, llty)
235+
// };
236+
// PlaceRef::new_sized(llval, layout)
237+
// }
238238

239239
fn const_ptrcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value {
240240
unsafe { llvm::LLVMConstPointerCast(val, ty) }

0 commit comments

Comments
 (0)