librustc: Implement a #[no_mangle] attribute to suppress name mangling. r=brson

This is very helpful for SDL, as SDL wants you to define a function named
`SDL_main`.
This commit is contained in:
Patrick Walton
2013-01-09 23:17:57 -08:00
parent 0c05a6c092
commit a0c2a9b743
7 changed files with 59 additions and 31 deletions

View File

@@ -80,6 +80,13 @@ fn path_to_str(p: path, itr: @ident_interner) -> ~str {
path_to_str_with_sep(p, ~"::", itr)
}
fn path_elt_to_str(pe: path_elt, itr: @ident_interner) -> ~str {
match pe {
path_mod(s) => *itr.get(s),
path_name(s) => *itr.get(s)
}
}
enum ast_node {
node_item(@item, @path),
node_foreign_item(@foreign_item, foreign_abi, @path),