FunctionCx: Add tcx field for easier access
MODIFY
src/base.rs
src/base.rs
@@ -30,6 +30,7 @@ pub(crate) fn trans_fn<'tcx, B: Backend + 'static>(
let mut fx = FunctionCx {
cx,
+ tcx,
pointer_type,
instance,

MODIFY
src/common.rs
src/common.rs
@@ -266,6 +266,7 @@ pub(crate) fn type_sign(ty: Ty<'_>) -> bool {
pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
pub(crate) cx: &'clif mut crate::CodegenCx<'tcx, B>,
+ pub(crate) tcx: TyCtxt<'tcx>,
pub(crate) pointer_type: Type, // Cached from module
pub(crate) instance: Instance<'tcx>,

FunctionCx: Add tcx field for easier access