1 use super::BackendTypes;
2 use rustc_hir::def_id::DefId;
3 use rustc_target::abi::Align;
5 pub trait StaticMethods: BackendTypes {
6 fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;
7 fn codegen_static(&self, def_id: DefId, is_mutable: bool);
9 /// Mark the given global value as "used", to prevent the compiler and linker from potentially
10 /// removing a static variable that may otherwise appear unused.
11 fn add_used_global(&self, global: Self::Value);
13 /// Same as add_used_global(), but only prevent the compiler from potentially removing an
14 /// otherwise unused symbol. The linker is still permitted to drop it.
16 /// This corresponds to the semantics of the `#[used]` attribute.
17 fn add_compiler_used_global(&self, global: Self::Value);
20 pub trait StaticBuilderMethods: BackendTypes {
21 fn get_static(&mut self, def_id: DefId) -> Self::Value;