15
16pub(crate) struct ConstantCx {
17▶ todo: Vec<TodoItem>,
18 anon_allocs: FxHashMap<AllocId, DataId>,
19}
· · ·
20
21#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
22▶enum TodoItem {
23 Alloc(AllocId),
24 Static(DefId),
· · ·
27impl ConstantCx {
28 pub(crate) fn new() -> Self {
29▶ ConstantCx { todo: vec![], anon_allocs: FxHashMap::default() }
30 }
31
· · ·
37pub(crate) fn codegen_static(tcx: TyCtxt<'_>, module: &mut dyn Module, def_id: DefId) -> DataId {
38 let mut constants_cx = ConstantCx::new();
39▶ constants_cx.todo.push(TodoItem::Static(def_id));
40 constants_cx.finalize(tcx, module);
41
· · ·
247 mutability: rustc_hir::Mutability,
248) -> DataId {
249▶ cx.todo.push(TodoItem::Alloc(alloc_id));
250 *cx.anon_allocs
251 .entry(alloc_id)
+ 7 more matches in this file