]> git.lizzy.rs Git - rust.git/blob - src/librustc_codegen_llvm/interfaces/statics.rs
0feb9d5255f5ce748cf78eb7c5839b977969977d
[rust.git] / src / librustc_codegen_llvm / interfaces / statics.rs
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.
4 //
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.
10
11 use super::backend::Backend;
12 use rustc::hir::def_id::DefId;
13 use rustc::ty::layout::Align;
14
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);
23 }