+extern crate rustc_target;
+
use syntax::ast::{IntTy, UintTy};
+use self::rustc_target::spec::{HasTargetSpec, Target};
use cretonne_module::{Module, Linkage, FuncId};
}
}
+impl<'a, 'tcx> layout::HasTyCtxt<'tcx> for &'a FunctionCx<'a, 'tcx> {
+ fn tcx<'b>(&'b self) -> TyCtxt<'b, 'tcx, 'tcx> {
+ self.tcx
+ }
+}
+
+impl<'a, 'tcx> layout::HasDataLayout for &'a FunctionCx<'a, 'tcx> {
+ fn data_layout(&self) -> &layout::TargetDataLayout {
+ &self.tcx.data_layout
+ }
+}
+
+impl<'a, 'tcx> HasTargetSpec for &'a FunctionCx<'a, 'tcx> {
+ fn target_spec(&self) -> &Target {
+ &self.tcx.sess.target.target
+ }
+}
+
impl<'f, 'tcx> FunctionCx<'f, 'tcx> {
pub fn monomorphize<T>(&self, value: &T) -> T
where T: TypeFoldable<'tcx>