Skip to content

Commit 767caa5

Browse files
committed
---
yaml --- r: 41309 b: refs/heads/snap-stage3 c: 2ea2628 h: refs/heads/master i: 41307: 6c310ed v: v3
1 parent b835a71 commit 767caa5

File tree

17 files changed

+764
-731
lines changed

17 files changed

+764
-731
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3105bcfdc11030abf9855af7a693cbf904460813
4+
refs/heads/snap-stage3: 2ea2628ca907e83cba63cc19d29a995c848a3434
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/back/abi.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,72 +11,72 @@
1111

1212

1313

14-
const rc_base_field_refcnt: uint = 0u;
14+
pub const rc_base_field_refcnt: uint = 0u;
1515

16-
const task_field_refcnt: uint = 0u;
16+
pub const task_field_refcnt: uint = 0u;
1717

18-
const task_field_stk: uint = 2u;
18+
pub const task_field_stk: uint = 2u;
1919

20-
const task_field_runtime_sp: uint = 3u;
20+
pub const task_field_runtime_sp: uint = 3u;
2121

22-
const task_field_rust_sp: uint = 4u;
22+
pub const task_field_rust_sp: uint = 4u;
2323

24-
const task_field_gc_alloc_chain: uint = 5u;
24+
pub const task_field_gc_alloc_chain: uint = 5u;
2525

26-
const task_field_dom: uint = 6u;
26+
pub const task_field_dom: uint = 6u;
2727

28-
const n_visible_task_fields: uint = 7u;
28+
pub const n_visible_task_fields: uint = 7u;
2929

30-
const dom_field_interrupt_flag: uint = 1u;
30+
pub const dom_field_interrupt_flag: uint = 1u;
3131

32-
const frame_glue_fns_field_mark: uint = 0u;
32+
pub const frame_glue_fns_field_mark: uint = 0u;
3333

34-
const frame_glue_fns_field_drop: uint = 1u;
34+
pub const frame_glue_fns_field_drop: uint = 1u;
3535

36-
const frame_glue_fns_field_reloc: uint = 2u;
36+
pub const frame_glue_fns_field_reloc: uint = 2u;
3737

38-
const box_field_refcnt: uint = 0u;
39-
const box_field_tydesc: uint = 1u;
40-
const box_field_prev: uint = 2u;
41-
const box_field_next: uint = 3u;
42-
const box_field_body: uint = 4u;
38+
pub const box_field_refcnt: uint = 0u;
39+
pub const box_field_tydesc: uint = 1u;
40+
pub const box_field_prev: uint = 2u;
41+
pub const box_field_next: uint = 3u;
42+
pub const box_field_body: uint = 4u;
4343

44-
const general_code_alignment: uint = 16u;
44+
pub const general_code_alignment: uint = 16u;
4545

46-
const tydesc_field_size: uint = 0u;
47-
const tydesc_field_align: uint = 1u;
48-
const tydesc_field_take_glue: uint = 2u;
49-
const tydesc_field_drop_glue: uint = 3u;
50-
const tydesc_field_free_glue: uint = 4u;
51-
const tydesc_field_visit_glue: uint = 5u;
52-
const tydesc_field_shape: uint = 6u;
53-
const tydesc_field_shape_tables: uint = 7u;
54-
const n_tydesc_fields: uint = 8u;
46+
pub const tydesc_field_size: uint = 0u;
47+
pub const tydesc_field_align: uint = 1u;
48+
pub const tydesc_field_take_glue: uint = 2u;
49+
pub const tydesc_field_drop_glue: uint = 3u;
50+
pub const tydesc_field_free_glue: uint = 4u;
51+
pub const tydesc_field_visit_glue: uint = 5u;
52+
pub const tydesc_field_shape: uint = 6u;
53+
pub const tydesc_field_shape_tables: uint = 7u;
54+
pub const n_tydesc_fields: uint = 8u;
5555

5656
// The two halves of a closure: code and environment.
57-
const fn_field_code: uint = 0u;
58-
const fn_field_box: uint = 1u;
57+
pub const fn_field_code: uint = 0u;
58+
pub const fn_field_box: uint = 1u;
5959

60-
const vec_elt_fill: uint = 0u;
60+
pub const vec_elt_fill: uint = 0u;
6161

62-
const vec_elt_alloc: uint = 1u;
62+
pub const vec_elt_alloc: uint = 1u;
6363

64-
const vec_elt_elems: uint = 2u;
64+
pub const vec_elt_elems: uint = 2u;
6565

66-
const slice_elt_base: uint = 0u;
67-
const slice_elt_len: uint = 1u;
66+
pub const slice_elt_base: uint = 0u;
67+
pub const slice_elt_len: uint = 1u;
6868

69-
const worst_case_glue_call_args: uint = 7u;
69+
pub const worst_case_glue_call_args: uint = 7u;
7070

71-
const abi_version: uint = 1u;
71+
pub const abi_version: uint = 1u;
7272

73-
fn memcpy_glue_name() -> ~str { return ~"rust_memcpy_glue"; }
73+
pub fn memcpy_glue_name() -> ~str { return ~"rust_memcpy_glue"; }
7474

75-
fn bzero_glue_name() -> ~str { return ~"rust_bzero_glue"; }
75+
pub fn bzero_glue_name() -> ~str { return ~"rust_bzero_glue"; }
7676

77-
fn yield_glue_name() -> ~str { return ~"rust_yield_glue"; }
77+
pub fn yield_glue_name() -> ~str { return ~"rust_yield_glue"; }
7878

79-
fn no_op_type_glue_name() -> ~str { return ~"rust_no_op_type_glue"; }
79+
pub fn no_op_type_glue_name() -> ~str { return ~"rust_no_op_type_glue"; }
8080
//
8181
// Local Variables:
8282
// mode: rust

branches/snap-stage3/src/librustc/back/arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use driver::session;
1313
use session::sess_os_to_meta_os;
1414
use metadata::loader::meta_section_name;
1515

16-
fn get_target_strs(target_os: session::os) -> target_strs::t {
16+
pub fn get_target_strs(target_os: session::os) -> target_strs::t {
1717
return {
1818
module_asm: ~"",
1919

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ use syntax::ast_map::{path, path_mod, path_name};
4343
use syntax::attr;
4444
use syntax::print::pprust;
4545

46-
enum output_type {
46+
#[deriving_eq]
47+
pub enum output_type {
4748
output_type_none,
4849
output_type_bitcode,
4950
output_type_assembly,
@@ -52,13 +53,6 @@ enum output_type {
5253
output_type_exe,
5354
}
5455

55-
impl output_type : cmp::Eq {
56-
pure fn eq(&self, other: &output_type) -> bool {
57-
((*self) as uint) == ((*other) as uint)
58-
}
59-
pure fn ne(&self, other: &output_type) -> bool { !(*self).eq(other) }
60-
}
61-
6256
pub fn llvm_err(sess: Session, +msg: ~str) -> ! {
6357
unsafe {
6458
let cstr = llvm::LLVMRustGetLastError();
@@ -170,15 +164,15 @@ pub mod jit {
170164
}
171165
}
172166

173-
mod write {
167+
pub mod write {
174168
use back::link::jit;
175-
use back::link::{ModuleRef, WriteOutputFile, output_type};
169+
use back::link::{WriteOutputFile, output_type};
176170
use back::link::{output_type_assembly, output_type_bitcode};
177171
use back::link::{output_type_exe, output_type_llvm_assembly};
178172
use back::link::{output_type_object};
179173
use driver::session;
180174
use lib::llvm::llvm;
181-
use lib::llvm::{False, True, mk_pass_manager, mk_target_data};
175+
use lib::llvm::{False, True, ModuleRef, mk_pass_manager, mk_target_data};
182176
use lib;
183177
use session::Session;
184178

@@ -456,7 +450,7 @@ mod write {
456450
*
457451
*/
458452

459-
fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
453+
pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
460454
symbol_hasher: &hash::State) -> link_meta {
461455

462456
type provided_metas =
@@ -575,15 +569,15 @@ fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
575569
return {name: name, vers: vers, extras_hash: extras_hash};
576570
}
577571

578-
fn truncated_hash_result(symbol_hasher: &hash::State) -> ~str {
572+
pub fn truncated_hash_result(symbol_hasher: &hash::State) -> ~str {
579573
unsafe {
580574
symbol_hasher.result_str()
581575
}
582576
}
583577

584578

585579
// This calculates STH for a symbol, as defined above
586-
fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
580+
pub fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
587581
link_meta: link_meta) -> @str {
588582
// NB: do *not* use abbrevs here as we want the symbol names
589583
// to be independent of one another in the crate.
@@ -601,7 +595,7 @@ fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
601595
hash.to_managed()
602596
}
603597
604-
fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
598+
pub fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
605599
match ccx.type_hashcodes.find(t) {
606600
Some(h) => h,
607601
None => {
@@ -615,7 +609,7 @@ fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
615609
616610
// Name sanitation. LLVM will happily accept identifiers with weird names, but
617611
// gas doesn't!
618-
fn sanitize(s: ~str) -> ~str {
612+
pub fn sanitize(s: ~str) -> ~str {
619613
let mut result = ~"";
620614
for str::chars_each(s) |c| {
621615
match c {
@@ -648,7 +642,7 @@ fn sanitize(s: ~str) -> ~str {
648642
return result;
649643
}
650644

651-
fn mangle(sess: Session, ss: path) -> ~str {
645+
pub fn mangle(sess: Session, ss: path) -> ~str {
652646
// Follow C++ namespace-mangling style
653647

654648
let mut n = ~"_ZN"; // Begin name-sequence.
@@ -663,26 +657,26 @@ fn mangle(sess: Session, ss: path) -> ~str {
663657
n
664658
}
665659

666-
fn exported_name(sess: Session,
667-
+path: path,
668-
hash: &str,
669-
vers: &str) -> ~str {
660+
pub fn exported_name(sess: Session,
661+
+path: path,
662+
hash: &str,
663+
vers: &str) -> ~str {
670664
return mangle(sess,
671665
vec::append_one(
672666
vec::append_one(path, path_name(sess.ident_of(hash.to_owned()))),
673667
path_name(sess.ident_of(vers.to_owned()))));
674668
}
675669

676-
fn mangle_exported_name(ccx: @crate_ctxt, +path: path, t: ty::t) -> ~str {
670+
pub fn mangle_exported_name(ccx: @crate_ctxt, +path: path, t: ty::t) -> ~str {
677671
let hash = get_symbol_hash(ccx, t);
678672
return exported_name(ccx.sess, path,
679673
hash,
680674
ccx.link_meta.vers);
681675
}
682676

683-
fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
684-
t: ty::t,
685-
name: &str) -> ~str {
677+
pub fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
678+
t: ty::t,
679+
name: &str) -> ~str {
686680
let s = ppaux::ty_to_short_str(ccx.tcx, t);
687681
let hash = get_symbol_hash(ccx, t);
688682
return mangle(ccx.sess,
@@ -691,23 +685,23 @@ fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
691685
path_name(ccx.sess.ident_of(hash.to_owned()))]);
692686
}
693687

694-
fn mangle_internal_name_by_path_and_seq(ccx: @crate_ctxt,
695-
+path: path,
696-
+flav: ~str) -> ~str {
688+
pub fn mangle_internal_name_by_path_and_seq(ccx: @crate_ctxt,
689+
+path: path,
690+
+flav: ~str) -> ~str {
697691
return mangle(ccx.sess,
698692
vec::append_one(path, path_name((ccx.names)(flav))));
699693
}
700694

701-
fn mangle_internal_name_by_path(ccx: @crate_ctxt, +path: path) -> ~str {
695+
pub fn mangle_internal_name_by_path(ccx: @crate_ctxt, +path: path) -> ~str {
702696
return mangle(ccx.sess, path);
703697
}
704698

705-
fn mangle_internal_name_by_seq(ccx: @crate_ctxt, +flav: ~str) -> ~str {
699+
pub fn mangle_internal_name_by_seq(ccx: @crate_ctxt, +flav: ~str) -> ~str {
706700
return fmt!("%s_%u", flav, (ccx.names)(flav).repr);
707701
}
708702

709703

710-
fn output_dll_filename(os: session::os, lm: link_meta) -> ~str {
704+
pub fn output_dll_filename(os: session::os, lm: link_meta) -> ~str {
711705
let libname = fmt!("%s-%s-%s", lm.name, lm.extras_hash, lm.vers);
712706
let (dll_prefix, dll_suffix) = match os {
713707
session::os_win32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
@@ -722,10 +716,10 @@ fn output_dll_filename(os: session::os, lm: link_meta) -> ~str {
722716

723717
// If the user wants an exe generated we need to invoke
724718
// cc to link the object file with some libs
725-
fn link_binary(sess: Session,
726-
obj_filename: &Path,
727-
out_filename: &Path,
728-
lm: link_meta) {
719+
pub fn link_binary(sess: Session,
720+
obj_filename: &Path,
721+
out_filename: &Path,
722+
lm: link_meta) {
729723
// Converts a library file-stem into a cc -l argument
730724
fn unlib(config: @session::config, +stem: ~str) -> ~str {
731725
if stem.starts_with("lib") &&

branches/snap-stage3/src/librustc/back/rpath.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,15 @@ use core::vec;
2121
use std::map::HashMap;
2222
use std::map;
2323

24-
export get_absolute_rpath;
25-
export get_install_prefix_rpath;
26-
export get_relative_to;
27-
export get_rpath_flags;
28-
export get_rpath_relative_to_output;
29-
export minimize_rpaths;
30-
export rpaths_to_flags;
31-
3224
pure fn not_win32(os: session::os) -> bool {
3325
match os {
3426
session::os_win32 => false,
3527
_ => true
3628
}
3729
}
3830

39-
fn get_rpath_flags(sess: session::Session, out_filename: &Path) -> ~[~str] {
31+
pub fn get_rpath_flags(sess: session::Session, out_filename: &Path)
32+
-> ~[~str] {
4033
let os = sess.targ_cfg.os;
4134

4235
// No rpath on windows
@@ -63,7 +56,7 @@ fn get_sysroot_absolute_rt_lib(sess: session::Session) -> Path {
6356
sess.filesearch.sysroot().push_rel(&r).push(os::dll_filename("rustrt"))
6457
}
6558

66-
fn rpaths_to_flags(rpaths: &[Path]) -> ~[~str] {
59+
pub fn rpaths_to_flags(rpaths: &[Path]) -> ~[~str] {
6760
vec::map(rpaths, |rpath| fmt!("-Wl,-rpath,%s",rpath.to_str()))
6861
}
6962

@@ -120,10 +113,10 @@ fn get_rpaths_relative_to_output(os: session::os,
120113
})
121114
}
122115

123-
fn get_rpath_relative_to_output(os: session::os,
124-
output: &Path,
125-
lib: &Path)
126-
-> Path {
116+
pub fn get_rpath_relative_to_output(os: session::os,
117+
output: &Path,
118+
lib: &Path)
119+
-> Path {
127120
use core::os;
128121

129122
assert not_win32(os);
@@ -141,7 +134,7 @@ fn get_rpath_relative_to_output(os: session::os,
141134
}
142135

143136
// Find the relative path from one file to another
144-
fn get_relative_to(abs1: &Path, abs2: &Path) -> Path {
137+
pub fn get_relative_to(abs1: &Path, abs2: &Path) -> Path {
145138
assert abs1.is_absolute;
146139
assert abs2.is_absolute;
147140
let abs1 = abs1.normalize();
@@ -178,11 +171,11 @@ fn get_absolute_rpaths(libs: &[Path]) -> ~[Path] {
178171
vec::map(libs, |a| get_absolute_rpath(a) )
179172
}
180173

181-
fn get_absolute_rpath(lib: &Path) -> Path {
174+
pub fn get_absolute_rpath(lib: &Path) -> Path {
182175
os::make_absolute(lib).dir_path()
183176
}
184177

185-
fn get_install_prefix_rpath(target_triple: &str) -> Path {
178+
pub fn get_install_prefix_rpath(target_triple: &str) -> Path {
186179
let install_prefix = env!("CFG_PREFIX");
187180

188181
if install_prefix == ~"" {
@@ -193,7 +186,7 @@ fn get_install_prefix_rpath(target_triple: &str) -> Path {
193186
os::make_absolute(&Path(install_prefix).push_rel(&tlib))
194187
}
195188

196-
fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
189+
pub fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
197190
let set = map::HashMap();
198191
let mut minimized = ~[];
199192
for rpaths.each |rpath| {

branches/snap-stage3/src/librustc/back/target_strs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111

12-
type t = {
12+
pub type t = {
1313
module_asm: ~str,
1414
meta_sect_name: ~str,
1515
data_layout: ~str,

0 commit comments

Comments
 (0)