File tree 4 files changed +12
-10
lines changed
4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ fn build_session(@session::options sopts) -> session::session {
355
355
auto target_cfg = build_target_config( ) ;
356
356
auto cstore = cstore:: mk_cstore( ) ;
357
357
ret session:: session( target_cfg, sopts, cstore,
358
- [ ] , codemap:: new_codemap( ) , 0 u) ;
358
+ codemap:: new_codemap( ) , 0 u) ;
359
359
}
360
360
361
361
fn parse_pretty( session:: session sess, & str name) -> pp_mode {
@@ -527,7 +527,7 @@ fn main(vec[str] args) {
527
527
gcc_args += [ "-l" + libarg] ;
528
528
}
529
529
530
- gcc_args += sess . get_used_link_args( ) ;
530
+ gcc_args += cstore :: get_used_link_args( cstore ) ;
531
531
auto used_libs = cstore:: get_used_libraries( cstore) ;
532
532
for ( str l in used_libs) {
533
533
gcc_args += [ "-l" + l] ;
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ type crate_metadata = rec(str name, vec[u8] data);
46
46
obj session( @config targ_cfg,
47
47
@options opts,
48
48
metadata:: cstore:: cstore cstore,
49
- mutable vec[ str] used_link_args,
50
49
codemap:: codemap cm,
51
50
mutable uint err_count) {
52
51
fn get_targ_cfg ( ) -> @config { ret targ_cfg; }
@@ -98,12 +97,6 @@ obj session(@config targ_cfg,
98
97
self . span_bug ( sp, "unimplemented " + msg) ;
99
98
}
100
99
fn unimpl ( str msg) -> ! { self . bug ( "unimplemented " + msg) ; }
101
- fn add_used_link_args ( & str args ) {
102
- used_link_args += str:: split ( args, ' ' as u8 ) ;
103
- }
104
- fn get_used_link_args ( ) -> vec[ str ] {
105
- ret used_link_args;
106
- }
107
100
fn get_codemap ( ) -> codemap:: codemap { ret cm; }
108
101
fn lookup_pos ( uint pos) -> codemap:: loc {
109
102
ret codemap:: lookup_pos ( cm, pos) ;
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ fn visit_item(env e, &@ast::item i) {
188
188
attr:: find_attrs_by_name( i. attrs, "link_args" ) ) {
189
189
alt ( attr:: get_meta_item_value_str( attr:: attr_meta( a) ) ) {
190
190
case ( some( ?linkarg) ) {
191
- e . sess . add_used_link_args( linkarg) ;
191
+ cstore :: add_used_link_args( cstore , linkarg) ;
192
192
}
193
193
case ( none) { /* fallthrough */ }
194
194
}
Original file line number Diff line number Diff line change 1
1
import std:: map;
2
2
import std:: vec;
3
+ import std:: str;
3
4
4
5
type crate_metadata = rec ( str name , vec[ u8] data ) ;
5
6
@@ -53,6 +54,14 @@ fn get_used_libraries(&cstore cstore) -> vec[str] {
53
54
ret cstore. used_libraries ;
54
55
}
55
56
57
+ fn add_used_link_args ( & cstore cstore, & str args ) {
58
+ cstore. used_link_args += str:: split ( args, ' ' as u8 ) ;
59
+ }
60
+
61
+ fn get_used_link_args ( & cstore cstore) -> vec[ str ] {
62
+ ret cstore. used_link_args ;
63
+ }
64
+
56
65
// Local Variables:
57
66
// mode: rust
58
67
// fill-column: 78;
You can’t perform that action at this time.
0 commit comments