@@ -12,7 +12,7 @@ use llvm::{self, ValueRef, AttributePlace};
1212use base;
1313use builder:: Builder ;
1414use common:: { ty_fn_sig, C_usize } ;
15- use context:: CrateContext ;
15+ use context:: CodegenCx ;
1616use cabi_x86;
1717use cabi_x86_64;
1818use cabi_x86_win64;
@@ -209,7 +209,7 @@ impl Reg {
209209}
210210
211211impl Reg {
212- pub fn align ( & self , ccx : & CrateContext ) -> Align {
212+ pub fn align ( & self , ccx : & CodegenCx ) -> Align {
213213 let dl = ccx. data_layout ( ) ;
214214 match self . kind {
215215 RegKind :: Integer => {
@@ -234,7 +234,7 @@ impl Reg {
234234 }
235235 }
236236
237- pub fn llvm_type ( & self , ccx : & CrateContext ) -> Type {
237+ pub fn llvm_type ( & self , ccx : & CodegenCx ) -> Type {
238238 match self . kind {
239239 RegKind :: Integer => Type :: ix ( ccx, self . size . bits ( ) ) ,
240240 RegKind :: Float => {
@@ -276,11 +276,11 @@ impl From<Reg> for Uniform {
276276}
277277
278278impl Uniform {
279- pub fn align ( & self , ccx : & CrateContext ) -> Align {
279+ pub fn align ( & self , ccx : & CodegenCx ) -> Align {
280280 self . unit . align ( ccx)
281281 }
282282
283- pub fn llvm_type ( & self , ccx : & CrateContext ) -> Type {
283+ pub fn llvm_type ( & self , ccx : & CodegenCx ) -> Type {
284284 let llunit = self . unit . llvm_type ( ccx) ;
285285
286286 if self . total <= self . unit . size {
@@ -307,7 +307,7 @@ impl Uniform {
307307
308308pub trait LayoutExt < ' tcx > {
309309 fn is_aggregate ( & self ) -> bool ;
310- fn homogeneous_aggregate < ' a > ( & self , ccx : & CrateContext < ' a , ' tcx > ) -> Option < Reg > ;
310+ fn homogeneous_aggregate < ' a > ( & self , ccx : & CodegenCx < ' a , ' tcx > ) -> Option < Reg > ;
311311}
312312
313313impl < ' tcx > LayoutExt < ' tcx > for TyLayout < ' tcx > {
@@ -321,7 +321,7 @@ impl<'tcx> LayoutExt<'tcx> for TyLayout<'tcx> {
321321 }
322322 }
323323
324- fn homogeneous_aggregate < ' a > ( & self , ccx : & CrateContext < ' a , ' tcx > ) -> Option < Reg > {
324+ fn homogeneous_aggregate < ' a > ( & self , ccx : & CodegenCx < ' a , ' tcx > ) -> Option < Reg > {
325325 match self . abi {
326326 layout:: Abi :: Uninhabited => None ,
327327
@@ -423,7 +423,7 @@ impl From<Uniform> for CastTarget {
423423}
424424
425425impl CastTarget {
426- pub fn size ( & self , ccx : & CrateContext ) -> Size {
426+ pub fn size ( & self , ccx : & CodegenCx ) -> Size {
427427 match * self {
428428 CastTarget :: Uniform ( u) => u. total ,
429429 CastTarget :: Pair ( a, b) => {
@@ -433,7 +433,7 @@ impl CastTarget {
433433 }
434434 }
435435
436- pub fn align ( & self , ccx : & CrateContext ) -> Align {
436+ pub fn align ( & self , ccx : & CodegenCx ) -> Align {
437437 match * self {
438438 CastTarget :: Uniform ( u) => u. align ( ccx) ,
439439 CastTarget :: Pair ( a, b) => {
@@ -444,7 +444,7 @@ impl CastTarget {
444444 }
445445 }
446446
447- pub fn llvm_type ( & self , ccx : & CrateContext ) -> Type {
447+ pub fn llvm_type ( & self , ccx : & CodegenCx ) -> Type {
448448 match * self {
449449 CastTarget :: Uniform ( u) => u. llvm_type ( ccx) ,
450450 CastTarget :: Pair ( a, b) => {
@@ -547,7 +547,7 @@ impl<'a, 'tcx> ArgType<'tcx> {
547547
548548 /// Get the LLVM type for an place of the original Rust type of
549549 /// this argument/return, i.e. the result of `type_of::type_of`.
550- pub fn memory_ty ( & self , ccx : & CrateContext < ' a , ' tcx > ) -> Type {
550+ pub fn memory_ty ( & self , ccx : & CodegenCx < ' a , ' tcx > ) -> Type {
551551 self . layout . llvm_type ( ccx)
552552 }
553553
@@ -647,23 +647,23 @@ pub struct FnType<'tcx> {
647647}
648648
649649impl < ' a , ' tcx > FnType < ' tcx > {
650- pub fn of_instance ( ccx : & CrateContext < ' a , ' tcx > , instance : & ty:: Instance < ' tcx > )
650+ pub fn of_instance ( ccx : & CodegenCx < ' a , ' tcx > , instance : & ty:: Instance < ' tcx > )
651651 -> Self {
652652 let fn_ty = instance. ty ( ccx. tcx ) ;
653653 let sig = ty_fn_sig ( ccx, fn_ty) ;
654654 let sig = ccx. tcx . erase_late_bound_regions_and_normalize ( & sig) ;
655655 FnType :: new ( ccx, sig, & [ ] )
656656 }
657657
658- pub fn new ( ccx : & CrateContext < ' a , ' tcx > ,
658+ pub fn new ( ccx : & CodegenCx < ' a , ' tcx > ,
659659 sig : ty:: FnSig < ' tcx > ,
660660 extra_args : & [ Ty < ' tcx > ] ) -> FnType < ' tcx > {
661661 let mut fn_ty = FnType :: unadjusted ( ccx, sig, extra_args) ;
662662 fn_ty. adjust_for_abi ( ccx, sig. abi ) ;
663663 fn_ty
664664 }
665665
666- pub fn new_vtable ( ccx : & CrateContext < ' a , ' tcx > ,
666+ pub fn new_vtable ( ccx : & CodegenCx < ' a , ' tcx > ,
667667 sig : ty:: FnSig < ' tcx > ,
668668 extra_args : & [ Ty < ' tcx > ] ) -> FnType < ' tcx > {
669669 let mut fn_ty = FnType :: unadjusted ( ccx, sig, extra_args) ;
@@ -688,7 +688,7 @@ impl<'a, 'tcx> FnType<'tcx> {
688688 fn_ty
689689 }
690690
691- pub fn unadjusted ( ccx : & CrateContext < ' a , ' tcx > ,
691+ pub fn unadjusted ( ccx : & CodegenCx < ' a , ' tcx > ,
692692 sig : ty:: FnSig < ' tcx > ,
693693 extra_args : & [ Ty < ' tcx > ] ) -> FnType < ' tcx > {
694694 debug ! ( "FnType::unadjusted({:?}, {:?})" , sig, extra_args) ;
@@ -863,7 +863,7 @@ impl<'a, 'tcx> FnType<'tcx> {
863863 }
864864
865865 fn adjust_for_abi ( & mut self ,
866- ccx : & CrateContext < ' a , ' tcx > ,
866+ ccx : & CodegenCx < ' a , ' tcx > ,
867867 abi : Abi ) {
868868 if abi == Abi :: Unadjusted { return }
869869
@@ -939,7 +939,7 @@ impl<'a, 'tcx> FnType<'tcx> {
939939 }
940940 }
941941
942- pub fn llvm_type ( & self , ccx : & CrateContext < ' a , ' tcx > ) -> Type {
942+ pub fn llvm_type ( & self , ccx : & CodegenCx < ' a , ' tcx > ) -> Type {
943943 let mut llargument_tys = Vec :: new ( ) ;
944944
945945 let llreturn_ty = match self . ret . mode {
0 commit comments