1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use super::backend::Backend;
12 use rustc::hir::def_id::DefId;
13 use rustc::ty::layout::Align;
15 pub trait StaticMethods<'tcx>: Backend<'tcx> {
16 fn static_ptrcast(&self, val: Self::Value, ty: Self::Type) -> Self::Value;
17 fn static_bitcast(&self, val: Self::Value, ty: Self::Type) -> Self::Value;
18 fn static_addr_of_mut(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;
19 fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;
20 fn get_static(&self, def_id: DefId) -> Self::Value;
21 fn codegen_static(&self, def_id: DefId, is_mutable: bool);
22 fn static_replace_all_uses(&self, old_g: Self::Value, new_g: Self::Value);