diff options
| author | Graydon Hoare <[email protected]> | 2010-12-09 14:37:50 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-12-09 14:37:50 -0800 |
| commit | 876282791e36c482676aeeaee722f5038126e175 (patch) | |
| tree | 6455132ac599209d9263440a5fcb7b8fe30b252b /src/comp/middle/trans.rs | |
| parent | Actually un-XFAIL drop-on-ret.rs. (diff) | |
| download | rust-876282791e36c482676aeeaee722f5038126e175.tar.xz rust-876282791e36c482676aeeaee722f5038126e175.zip | |
First sketch of support for const items, not including most of trans.
Diffstat (limited to 'src/comp/middle/trans.rs')
| -rw-r--r-- | src/comp/middle/trans.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 0a74b7a0..8249d31d 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -2001,6 +2001,10 @@ fn collect_item(&@crate_ctxt cx, @ast.item i) -> @crate_ctxt { cx.item_ids.insert(fid, llfn); } + case (ast.item_const(?name, _, _, ?cid, _)) { + cx.items.insert(cid, i); + } + case (ast.item_mod(?name, ?m, ?mid)) { cx.items.insert(mid, i); } @@ -2128,6 +2132,14 @@ fn trans_constant(&@crate_ctxt cx, @ast.item it) -> @crate_ctxt { i += 1u; } } + + case (ast.item_const(?name, _, ?expr, ?cid, ?ann)) { + // FIXME: The whole expr-translation system needs cloning to deal + // with consts. + auto v = C_int(1); + cx.item_ids.insert(cid, v); + } + case (_) { // empty } |