}
}
-pub fn C_floating_f64(f: f64, t: Type) -> ValueRef {
- unsafe {
- llvm::LLVMConstReal(t.to_ref(), f)
- }
-}
-
pub fn C_nil(ccx: &CrateContext) -> ValueRef {
C_struct(ccx, &[], false)
}
}
}
-fn is_const_integral(v: ValueRef) -> bool {
+pub fn is_const_integral(v: ValueRef) -> bool {
unsafe {
!llvm::LLVMIsAConstantInt(v).is_null()
}
-> ty::PolyFnSig<'tcx>
{
match ty.sty {
- ty::TyFnDef(_, _, sig) => sig,
+ ty::TyFnDef(..) |
// Shims currently have type TyFnPtr. Not sure this should remain.
- ty::TyFnPtr(sig) => sig,
+ ty::TyFnPtr(_) => ty.fn_sig(ccx.tcx()),
ty::TyClosure(def_id, substs) => {
let tcx = ccx.tcx();
- let sig = tcx.closure_type(def_id).subst(tcx, substs.substs);
+ let sig = tcx.fn_sig(def_id).subst(tcx, substs.substs);
let env_region = ty::ReLateBound(ty::DebruijnIndex::new(1), ty::BrEnv);
let env_ty = match tcx.closure_kind(def_id) {