diff options
Diffstat (limited to 'src/gen.rs')
-rw-r--r-- | src/gen.rs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -52,6 +52,10 @@ impl<'r> GenCtx<'r> { ret.reverse(); ret } + + fn current_module(&self) -> &Module { + self.module_map.get(&self.current_module_id).expect("Module not found!") + } } fn first<A, B>((val, _): (A, B)) -> A { @@ -448,7 +452,9 @@ fn gen_globals(mut ctx: &mut GenCtx, let mut defs = vec!(); gs = remove_redundant_decl(gs); - for g in gs.into_iter() { + for mut g in gs.into_iter() { + // XXX unify with anotations both type_blacklisted + // and type_opaque (which actually doesn't mean the same). if type_blacklisted(ctx, &g) { continue; } @@ -462,6 +468,10 @@ fn gen_globals(mut ctx: &mut GenCtx, continue; } + if let Some(substituted) = ctx.current_module().translations.get(&g.name()) { + g = substituted.clone(); + } + match g { GType(ti) => { let t = ti.borrow().clone(); |