Skip to content

Commit c17c412

Browse files
committed
---
yaml --- r: 79579 b: refs/heads/auto c: c684df1 h: refs/heads/master i: 79577: 2085ff2 79575: 0ced1c2 v: v3
1 parent 886ed02 commit c17c412

File tree

11 files changed

+196
-96
lines changed

11 files changed

+196
-96
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 13d33064a6c8b8f9c167250ec9a84fc8daaf56d5
16+
refs/heads/auto: c684df103e05a15d4e0403b5fca1197f16d15703
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/doc/rust.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,9 +3385,11 @@ The path to a module consists of the crate name, any parent modules,
33853385
then the module itself, all separated by double colons (`::`). The
33863386
optional log level can be appended to the module path with an equals
33873387
sign (`=`) followed by the log level, from 1 to 4, inclusive. Level 1
3388-
is the error level, 2 is warning, 3 info, and 4 debug. Any logs
3389-
less than or equal to the specified level will be output. If not
3390-
specified then log level 4 is assumed.
3388+
is the error level, 2 is warning, 3 info, and 4 debug. You can also
3389+
use the symbolic constants `error`, `warn`, `info`, and `debug`. Any
3390+
logs less than or equal to the specified level will be output. If not
3391+
specified then log level 4 is assumed. However, debug messages are
3392+
only available if `--cfg=debug` is passed to `rustc`.
33913393

33923394
As an example, to see all the logs generated by the compiler, you would set
33933395
`RUST_LOG` to `rustc`, which is the crate name (as specified in its `link`

branches/auto/src/librustc/back/link.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
3939
use syntax::attr;
4040
use syntax::attr::{AttrMetaMethods};
4141
use syntax::print::pprust;
42+
use syntax::parse::token;
4243

4344
#[deriving(Clone, Eq)]
4445
pub enum output_type {
@@ -677,8 +678,8 @@ pub fn symbol_hash(tcx: ty::ctxt,
677678
write_string(symbol_hasher, "-");
678679
write_string(symbol_hasher, encoder::encoded_ty(tcx, t));
679680
let mut hash = truncated_hash_result(symbol_hasher);
680-
// Prefix with 'h' so that it never blends into adjacent digits
681-
hash.unshift_char('h');
681+
// Prefix with _ so that it never blends into adjacent digits
682+
hash.unshift_char('_');
682683
// tjc: allocation is unfortunate; need to change std::hash
683684
hash.to_managed()
684685
}
@@ -721,7 +722,7 @@ pub fn sanitize(s: &str) -> ~str {
721722
'a' .. 'z'
722723
| 'A' .. 'Z'
723724
| '0' .. '9'
724-
| '_' | '.' | '$' => result.push_char(c),
725+
| '_' | '.' => result.push_char(c),
725726

726727
_ => {
727728
let mut tstr = ~"";
@@ -846,25 +847,28 @@ pub fn mangle_internal_name_by_type_and_seq(ccx: &mut CrateContext,
846847
name: &str) -> ~str {
847848
let s = ppaux::ty_to_str(ccx.tcx, t);
848849
let hash = get_symbol_hash(ccx, t);
849-
let (_, name) = gensym_name(name);
850850
return mangle(ccx.sess,
851-
~[path_name(ccx.sess.ident_of(s)), name],
851+
~[path_name(ccx.sess.ident_of(s)),
852+
path_name(gensym_name(name))],
852853
Some(hash.as_slice()),
853854
None);
854855
}
855856

856857
pub fn mangle_internal_name_by_path_and_seq(ccx: &mut CrateContext,
857858
mut path: path,
858859
flav: &str) -> ~str {
859-
let (_, name) = gensym_name(flav);
860-
path.push(name);
860+
path.push(path_name(gensym_name(flav)));
861861
mangle(ccx.sess, path, None, None)
862862
}
863863

864864
pub fn mangle_internal_name_by_path(ccx: &mut CrateContext, path: path) -> ~str {
865865
mangle(ccx.sess, path, None, None)
866866
}
867867

868+
pub fn mangle_internal_name_by_seq(_ccx: &mut CrateContext, flav: &str) -> ~str {
869+
return fmt!("%s_%u", flav, token::gensym(flav));
870+
}
871+
868872

869873
pub fn output_dll_filename(os: session::Os, lm: LinkMeta) -> ~str {
870874
let (dll_prefix, dll_suffix) = match os {

branches/auto/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,13 +1063,12 @@ fn encode_info_for_item(ecx: &EncodeContext,
10631063
let impl_vtables = ty::lookup_impl_vtables(tcx, def_id);
10641064
encode_impl_vtables(ebml_w, ecx, &impl_vtables);
10651065
}
1066-
let elt = ast_map::impl_pretty_name(opt_trait, ty, item.ident);
1067-
encode_path(ecx, ebml_w, path, elt);
1066+
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
10681067
ebml_w.end_tag();
10691068

10701069
// >:-<
10711070
let mut impl_path = vec::append(~[], path);
1072-
impl_path.push(elt);
1071+
impl_path.push(ast_map::path_name(item.ident));
10731072

10741073
// Iterate down the methods, emitting them. We rely on the
10751074
// assumption that all of the actually implemented methods

branches/auto/src/librustc/middle/trans/common.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ use std::hashmap::{HashMap};
3939
use std::libc::{c_uint, c_longlong, c_ulonglong, c_char};
4040
use std::vec;
4141
use syntax::ast::Ident;
42-
use syntax::ast_map::{path, path_elt, path_pretty_name};
42+
use syntax::ast_map::{path, path_elt};
4343
use syntax::codemap::Span;
4444
use syntax::parse::token;
4545
use syntax::{ast, ast_map};
4646

4747
pub use middle::trans::context::CrateContext;
4848

49-
pub fn gensym_name(name: &str) -> (Ident, path_elt) {
50-
let name = token::gensym(name);
51-
let ident = Ident::new(name);
52-
(ident, path_pretty_name(ident, name as u64))
49+
pub fn gensym_name(name: &str) -> Ident {
50+
token::str_to_ident(fmt!("%s_%u", name, token::gensym(name)))
5351
}
5452

5553
pub struct tydesc_info {

branches/auto/src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ use std::ptr;
6969
use std::vec;
7070
use syntax::codemap::Span;
7171
use syntax::{ast, codemap, ast_util, ast_map, opt_vec};
72-
use syntax::parse::token;
7372
use syntax::parse::token::special_idents;
7473

7574
static DW_LANG_RUST: c_uint = 0x9000;
@@ -514,8 +513,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
514513
ast_map::node_expr(ref expr) => {
515514
match expr.node {
516515
ast::ExprFnBlock(ref fn_decl, ref top_level_block) => {
517-
let name = fmt!("fn%u", token::gensym("fn"));
518-
let name = token::str_to_ident(name);
516+
let name = gensym_name("fn");
519517
(name, fn_decl,
520518
// This is not quite right. It should actually inherit the generics of the
521519
// enclosing function.

branches/auto/src/librustc/middle/trans/meth.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use std::vec;
3737
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
3838
use syntax::ast_util;
3939
use syntax::{ast, ast_map};
40-
use syntax::parse::token;
4140
use syntax::visit;
4241

4342
/**
@@ -569,8 +568,8 @@ pub fn make_vtable(ccx: &mut CrateContext,
569568
}
570569

571570
let tbl = C_struct(components);
572-
let sym = token::gensym("vtable");
573-
let vt_gvar = do fmt!("vtable%u", sym).with_c_str |buf| {
571+
let vtable = ccx.sess.str_of(gensym_name("vtable"));
572+
let vt_gvar = do vtable.with_c_str |buf| {
574573
llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf)
575574
};
576575
llvm::LLVMSetInitializer(vt_gvar, tbl);

branches/auto/src/librustc/middle/trans/monomorphize.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use util::ppaux::{Repr,ty_to_str};
3131

3232
use syntax::ast;
3333
use syntax::ast_map;
34+
use syntax::ast_map::path_name;
3435
use syntax::ast_util::local_def;
3536

3637
pub fn monomorphic_fn(ccx: @mut CrateContext,
@@ -193,7 +194,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
193194
}
194195
ccx.monomorphizing.insert(fn_id, depth + 1);
195196

196-
let (_, elt) = gensym_name(ccx.sess.str_of(name));
197+
let elt = path_name(gensym_name(ccx.sess.str_of(name)));
197198
let mut pt = (*pt).clone();
198199
pt.push(elt);
199200
let s = mangle_exported_name(ccx, pt.clone(), mono_ty);

0 commit comments

Comments
 (0)