@@ -74,6 +74,7 @@ struct Stats {
7474 attr_bytes : uint ,
7575 dep_bytes : uint ,
7676 lang_item_bytes : uint ,
77+ link_args_bytes : uint ,
7778 item_bytes : uint ,
7879 index_bytes : uint ,
7980 zero_bytes : uint ,
@@ -1255,6 +1256,20 @@ fn encode_lang_items(ecx: @EncodeContext, ebml_w: writer::Encoder) {
12551256 ebml_w.end_tag(); // tag_lang_items
12561257}
12571258
1259+ fn encode_link_args(ecx: @EncodeContext,
1260+ ebml_w: writer::Encoder) {
1261+ ebml_w.start_tag(tag_link_args);
1262+
1263+ let link_args = cstore::get_used_link_args(ecx.cstore);
1264+ for link_args.each |link_arg| {
1265+ ebml_w.start_tag(tag_link_args_arg);
1266+ ebml_w.writer.write_str(link_arg.to_str());
1267+ ebml_w.end_tag();
1268+ }
1269+
1270+ ebml_w.end_tag();
1271+ }
1272+
12581273fn encode_crate_dep(ecx: @EncodeContext, ebml_w: writer::Encoder,
12591274 dep: decoder::crate_dep) {
12601275 ebml_w.start_tag(tag_crate_dep);
@@ -1291,6 +1306,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
12911306 attr_bytes: 0,
12921307 dep_bytes: 0,
12931308 lang_item_bytes: 0,
1309+ link_args_bytes: 0,
12941310 item_bytes: 0,
12951311 index_bytes: 0,
12961312 zero_bytes: 0,
@@ -1329,6 +1345,11 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
13291345 encode_lang_items(ecx, ebml_w);
13301346 ecx.stats.lang_item_bytes = wr.pos - i;
13311347
1348+ // Encode the link args.
1349+ i = wr.pos;
1350+ encode_link_args(ecx, ebml_w);
1351+ ecx.stats.link_args_bytes = wr.pos - i;
1352+
13321353 // Encode and index the items.
13331354 ebml_w.start_tag(tag_items);
13341355 i = wr.pos;
@@ -1359,6 +1380,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
13591380 io::println(fmt!(" attribute bytes: %u", ecx.stats.attr_bytes));
13601381 io::println(fmt!(" dep bytes: %u", ecx.stats.dep_bytes));
13611382 io::println(fmt!(" lang item bytes: %u", ecx.stats.lang_item_bytes));
1383+ io::println(fmt!(" link args bytes: %u", ecx.stats.link_args_bytes));
13621384 io::println(fmt!(" item bytes: %u", ecx.stats.item_bytes));
13631385 io::println(fmt!(" index bytes: %u", ecx.stats.index_bytes));
13641386 io::println(fmt!(" zero bytes: %u", ecx.stats.zero_bytes));
0 commit comments