@@ -71,13 +71,12 @@ fn codegen_field<'a, 'tcx: 'a>(
71
71
pub enum CValue < ' tcx > {
72
72
ByRef ( Value , TyLayout < ' tcx > ) ,
73
73
ByVal ( Value , TyLayout < ' tcx > ) ,
74
- Func ( FuncRef , TyLayout < ' tcx > ) ,
75
74
}
76
75
77
76
impl < ' tcx > CValue < ' tcx > {
78
77
pub fn layout ( & self ) -> TyLayout < ' tcx > {
79
78
match * self {
80
- CValue :: ByRef ( _, layout) | CValue :: ByVal ( _, layout) | CValue :: Func ( _ , layout ) => layout,
79
+ CValue :: ByRef ( _, layout) | CValue :: ByVal ( _, layout) => layout,
81
80
}
82
81
}
83
82
@@ -96,10 +95,6 @@ impl<'tcx> CValue<'tcx> {
96
95
fx. bcx . ins ( ) . stack_store ( value, stack_slot, 0 ) ;
97
96
fx. bcx . ins ( ) . stack_addr ( types:: I64 , stack_slot, 0 )
98
97
}
99
- CValue :: Func ( func, ty) => {
100
- let func = fx. bcx . ins ( ) . func_addr ( types:: I64 , func) ;
101
- CValue :: ByVal ( func, ty) . force_stack ( fx)
102
- }
103
98
}
104
99
}
105
100
@@ -115,15 +110,13 @@ impl<'tcx> CValue<'tcx> {
115
110
fx. bcx . ins ( ) . load ( cton_ty, MemFlags :: new ( ) , addr, 0 )
116
111
}
117
112
CValue :: ByVal ( value, _layout) => value,
118
- CValue :: Func ( func, _layout) => fx. bcx . ins ( ) . func_addr ( types:: I64 , func) ,
119
113
}
120
114
}
121
115
122
116
pub fn expect_byref ( self ) -> ( Value , TyLayout < ' tcx > ) {
123
117
match self {
124
118
CValue :: ByRef ( value, layout) => ( value, layout) ,
125
119
CValue :: ByVal ( _, _) => bug ! ( "Expected CValue::ByRef, found CValue::ByVal: {:?}" , self ) ,
126
- CValue :: Func ( _, _) => bug ! ( "Expected CValue::ByRef, found CValue::Func: {:?}" , self ) ,
127
120
}
128
121
}
129
122
@@ -161,7 +154,6 @@ impl<'tcx> CValue<'tcx> {
161
154
match self {
162
155
CValue :: ByRef ( addr, _) => CValue :: ByRef ( addr, layout) ,
163
156
CValue :: ByVal ( val, _) => CValue :: ByVal ( val, layout) ,
164
- CValue :: Func ( fun, _) => CValue :: Func ( fun, layout) ,
165
157
}
166
158
}
167
159
}
0 commit comments