@@ -4,7 +4,7 @@ use std::ptr;
4
4
5
5
use libc:: { c_char, c_uint} ;
6
6
use rustc_abi as abi;
7
- use rustc_abi:: { AddressSpace , Align , HasDataLayout , Size , TargetDataLayout , WrappingRange } ;
7
+ use rustc_abi:: { Align , HasDataLayout , Size , TargetDataLayout , WrappingRange } ;
8
8
use rustc_codegen_ssa:: MemFlags ;
9
9
use rustc_codegen_ssa:: common:: { AtomicOrdering , IntPredicate , RealPredicate , TypeKind } ;
10
10
use rustc_codegen_ssa:: mir:: operand:: { OperandRef , OperandValue } ;
@@ -829,22 +829,8 @@ impl<'ll, 'tcx, 'a> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
829
829
unsafe { llvm:: LLVMBuildIntToPtr ( self . llbuilder , val, dest_ty, UNNAMED ) }
830
830
}
831
831
832
- fn bitcast ( & mut self , mut val : & ' ll Value , dest_ty : & ' ll Type ) -> & ' ll Value {
833
- trace ! ( "Bitcast `{:?}` to ty `{:?}`" , val, dest_ty) ;
834
- unsafe {
835
- let ty = self . val_ty ( val) ;
836
- let kind = llvm:: LLVMRustGetTypeKind ( ty) ;
837
- if kind == llvm:: TypeKind :: Pointer {
838
- let element = self . element_type ( ty) ;
839
- let addrspace = llvm:: LLVMGetPointerAddressSpace ( ty) ;
840
- let new_ty = self . type_ptr_to_ext ( element, AddressSpace :: DATA ) ;
841
- if addrspace != 0 {
842
- trace ! ( "injecting addrspace cast for `{:?}` to `{:?}`" , ty, new_ty) ;
843
- val = llvm:: LLVMBuildAddrSpaceCast ( self . llbuilder , val, new_ty, UNNAMED ) ;
844
- }
845
- }
846
- llvm:: LLVMBuildBitCast ( self . llbuilder , val, dest_ty, UNNAMED )
847
- }
832
+ fn bitcast ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> & ' ll Value {
833
+ unsafe { llvm:: LLVMBuildBitCast ( self . llbuilder , val, dest_ty, UNNAMED ) }
848
834
}
849
835
850
836
fn intcast ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type , is_signed : bool ) -> & ' ll Value {
0 commit comments