Struct rustc::middle::trans::context::CrateContext[src]

pub struct CrateContext {
    pub llmod: ModuleRef,
    pub llcx: ContextRef,
    pub metadata_llmod: ModuleRef,
    pub td: TargetData,
    pub tn: TypeNames,
    pub externs: RefCell<ExternMap>,
    pub item_vals: RefCell<NodeMap<ValueRef>>,
    pub exp_map2: ExportMap2,
    pub reachable: NodeSet,
    pub item_symbols: RefCell<NodeMap<String>>,
    pub link_meta: LinkMeta,
    pub drop_glues: RefCell<HashMap<t, ValueRef>>,
    pub tydescs: RefCell<HashMap<t, Rc<tydesc_info>>>,
    pub finished_tydescs: Cell<bool>,
    pub external: RefCell<DefIdMap<Option<NodeId>>>,
    pub external_srcs: RefCell<NodeMap<DefId>>,
    pub non_inlineable_statics: RefCell<NodeSet>,
    pub monomorphized: RefCell<HashMap<MonoId, ValueRef>>,
    pub monomorphizing: RefCell<DefIdMap<uint>>,
    pub vtables: RefCell<HashMap<(t, MonoId), ValueRef>>,
    pub const_cstr_cache: RefCell<HashMap<InternedString, ValueRef>>,
    pub const_globals: RefCell<HashMap<int, ValueRef>>,
    pub const_values: RefCell<NodeMap<ValueRef>>,
    pub extern_const_values: RefCell<DefIdMap<ValueRef>>,
    pub impl_method_cache: RefCell<HashMap<(DefId, Name), DefId>>,
    pub closure_bare_wrapper_cache: RefCell<HashMap<ValueRef, ValueRef>>,
    pub lltypes: RefCell<HashMap<t, Type>>,
    pub llsizingtypes: RefCell<HashMap<t, Type>>,
    pub adt_reprs: RefCell<HashMap<t, Rc<Repr>>>,
    pub symbol_hasher: RefCell<Sha256>,
    pub type_hashcodes: RefCell<HashMap<t, String>>,
    pub all_llvm_symbols: RefCell<HashSet<String>>,
    pub tcx: ctxt,
    pub stats: Stats,
    pub int_type: Type,
    pub opaque_vec_type: Type,
    pub builder: BuilderRef_res,
    pub uses_gc: bool,
    pub dbg_cx: Option<CrateDebugContext>,
    pub eh_personality: RefCell<Option<ValueRef>>,
    // some fields omitted
}

Fields

llmod
llcx
metadata_llmod
td
tn
externs
item_vals
exp_map2
reachable
item_symbols
drop_glues
tydescs
finished_tydescs

Set when running emit_tydescs to enforce that no more tydescs are created.

external

Track mapping of external ids to local items imported for inlining

external_srcs

Backwards version of the external map (inlined items to where they came from)

non_inlineable_statics

A set of static items which cannot be inlined into other crates. This will prevent in IIItem() structures from being encoded into the metadata that is generated

monomorphized

Cache instances of monomorphized functions

monomorphizing
vtables

Cache generated vtables

const_cstr_cache

Cache of constant strings,

const_globals

Reverse-direction for const ptrs cast from globals. Key is an int, cast from a ValueRef holding a *T, Val is a ValueRef holding a *[T].

Needed because LLVM loses pointer->pointee association when we ptrcast, and we have to ptrcast during translation of a [T] const because we form a slice, a [*T,int] pair, not a pointer to an LLVM array type.

const_values

Cache of emitted const values

extern_const_values

Cache of external const values

impl_method_cache
closure_bare_wrapper_cache

Cache of closure wrappers for bare fn's.

lltypes
llsizingtypes
adt_reprs
symbol_hasher
type_hashcodes
all_llvm_symbols
tcx
stats
int_type
opaque_vec_type
builder
uses_gc

Set when at least one function uses GC. Needed so that decl_gc_metadata knows whether to link to the module metadata, which is not emitted by LLVM's GC pass when no functions use GC.

dbg_cx
eh_personality

Methods

impl CrateContext

fn new(name: &str, tcx: ctxt, emap2: ExportMap2, symbol_hasher: Sha256, link_meta: LinkMeta, reachable: NodeSet) -> CrateContext

fn tcx<'a>(&'a self) -> &'a ctxt

fn sess<'a>(&'a self) -> &'a Session

fn builder<'a>(&'a self) -> Builder<'a>

fn tydesc_type(&self) -> Type

fn get_intrinsic(&self, key: &&'static str) -> ValueRef

fn is_split_stack_supported(&self) -> bool