X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_codegen_llvm%2Fcontext.rs;h=0a780fecf41de768019dfa228b38ac0aec57403b;hb=fff08cb04389497d254fb40948674cbbee402908;hp=ead9bad656db5605d2138cdcc8ae2ba97bc1bcca;hpb=fb4652e85f1729412f6298aea033cb26b4755de9;p=rust.git diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index ead9bad656d..0a780fecf41 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -35,7 +35,7 @@ /// `llvm::Context` so that several compilation units may be optimized in parallel. /// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`. pub struct CodegenCx<'ll, 'tcx: 'll> { - pub tcx: TyCtxt<'ll, 'tcx, 'tcx>, + pub tcx: TyCtxt<'tcx, 'tcx>, pub check_overflow: bool, pub use_dll_storage_attrs: bool, pub tls_model: llvm::ThreadLocalMode, @@ -47,8 +47,8 @@ pub struct CodegenCx<'ll, 'tcx: 'll> { /// Cache instances of monomorphic and polymorphic items pub instances: RefCell, &'ll Value>>, /// Cache generated vtables - pub vtables: RefCell, Option>), &'ll Value>>, + pub vtables: + RefCell, Option>), &'ll Value>>, /// Cache of constant strings, pub const_cstr_cache: RefCell>, @@ -141,7 +141,7 @@ pub fn is_pie_binary(sess: &Session) -> bool { } pub unsafe fn create_module( - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, llcx: &'ll llvm::Context, mod_name: &str, ) -> &'ll llvm::Module { @@ -207,10 +207,11 @@ pub unsafe fn create_module( } impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { - crate fn new(tcx: TyCtxt<'ll, 'tcx, 'tcx>, - codegen_unit: Arc>, - llvm_module: &'ll crate::ModuleLlvm) - -> Self { + crate fn new( + tcx: TyCtxt<'tcx, 'tcx>, + codegen_unit: Arc>, + llvm_module: &'ll crate::ModuleLlvm, + ) -> Self { // An interesting part of Windows which MSVC forces our hand on (and // apparently MinGW didn't) is the usage of `dllimport` and `dllexport` // attributes in LLVM IR as well as native dependencies (in C these @@ -645,6 +646,11 @@ macro_rules! vector_types { ifn!("llvm.fabs.v4f64", fn(t_v4f64) -> t_v4f64); ifn!("llvm.fabs.v8f64", fn(t_v8f64) -> t_v8f64); + ifn!("llvm.minnum.f32", fn(t_f32, t_f32) -> t_f32); + ifn!("llvm.minnum.f64", fn(t_f64, t_f64) -> t_f64); + ifn!("llvm.maxnum.f32", fn(t_f32, t_f32) -> t_f32); + ifn!("llvm.maxnum.f64", fn(t_f64, t_f64) -> t_f64); + ifn!("llvm.floor.f32", fn(t_f32) -> t_f32); ifn!("llvm.floor.v2f32", fn(t_v2f32) -> t_v2f32); ifn!("llvm.floor.v4f32", fn(t_v4f32) -> t_v4f32); @@ -833,7 +839,7 @@ fn target_spec(&self) -> &Target { } impl ty::layout::HasTyCtxt<'tcx> for CodegenCx<'ll, 'tcx> { - fn tcx<'a>(&'a self) -> TyCtxt<'a, 'tcx, 'tcx> { + fn tcx(&self) -> TyCtxt<'tcx, 'tcx> { self.tcx } }