1
Fork 0

librustc: Respect no_mangle attribute on statics.

This commit is contained in:
Luqman Aden 2013-07-26 23:19:58 -04:00
parent 5c4cd30f80
commit e82394013d

View file

@ -2453,7 +2453,12 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::node_id) -> ValueRef {
let v = match i.node {
ast::item_static(_, m, expr) => {
let typ = ty::node_id_to_type(ccx.tcx, i.id);
let s = mangle_exported_name(ccx, my_path, typ);
let s =
if attr::contains_name(i.attrs, "no_mangle") {
path_elt_to_str(*my_path.last(), token::get_ident_interner())
} else {
mangle_exported_name(ccx, my_path, typ)
};
// We need the translated value here, because for enums the
// LLVM type is not fully determined by the Rust type.
let v = consts::const_expr(ccx, expr);