Skip to content

Commit

Permalink
Auto merge of rust-lang#38286 - pftbest:msp430_at_symbol, r=michaelwo…
Browse files Browse the repository at this point in the history
…erister

[MSP430] Do not generate '@' character in symbol names.

MSP430 assembler does not like '@' character in symbol names, so we need
to replace it with some other character.

Fixes rust-lang#38116
  • Loading branch information
bors committed Dec 13, 2016
2 parents b1a2ab8 + 9d764fc commit ace092f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/librustc_data_structures/base_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use std::str;

pub const MAX_BASE: u64 = 64;
pub const ALPHANUMERIC_ONLY: u64 = 62;

const BASE_64: &'static [u8; MAX_BASE as usize] =
b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@$";

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
let mut name = String::with_capacity(prefix.len() + 6);
name.push_str(prefix);
name.push_str(".");
base_n::push_str(idx as u64, base_n::MAX_BASE, &mut name);
base_n::push_str(idx as u64, base_n::ALPHANUMERIC_ONLY, &mut name);
name
}
}
Expand Down

0 comments on commit ace092f

Please sign in to comment.