about summary refs log tree commit diff
path: root/src/rustc/metadata
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-08-25 15:09:33 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-08-25 15:09:33 -0700
commit8ef455190494d2fd9a6bb013efd2e59622af2bc4 (patch)
tree79b59597ad931e5be3d5440f50c8942a53e3e495 /src/rustc/metadata
parentbb5c07922f20559af1e40d63a15b1be0402e5fe4 (diff)
downloadrust-8ef455190494d2fd9a6bb013efd2e59622af2bc4.tar.gz
rust-8ef455190494d2fd9a6bb013efd2e59622af2bc4.zip
rustc: Implement foreign constants.
This is needed for a lot of Apple libraries, as Apple tends to put a lot of
globals in dynamic libraries.
Diffstat (limited to 'src/rustc/metadata')
-rw-r--r--src/rustc/metadata/encoder.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rustc/metadata/encoder.rs b/src/rustc/metadata/encoder.rs
index 66d74c377ca..24b259f84f6 100644
--- a/src/rustc/metadata/encoder.rs
+++ b/src/rustc/metadata/encoder.rs
@@ -803,6 +803,14 @@ fn encode_info_for_foreign_item(ecx: @encode_ctxt, ebml_w: ebml::writer,
         }
         encode_path(ecx, ebml_w, path, ast_map::path_name(nitem.ident));
       }
+      foreign_item_const(t) => {
+        encode_def_id(ebml_w, local_def(nitem.id));
+        encode_family(ebml_w, 'c');
+        encode_type(ecx, ebml_w, node_id_to_type(ecx.tcx, nitem.id));
+        encode_symbol(ecx, ebml_w, nitem.id);
+        encode_path(ecx, ebml_w, path, ast_map::path_name(nitem.ident));
+        ebml_w.end_tag();
+      }
     }
     ebml_w.end_tag();
 }