Skip to content

Commit 21cc0cc

Browse files
yichoithestinger
authored andcommitted
librustc: fix #7467 for android
1 parent 51beba6 commit 21cc0cc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc/middle/trans/meth.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ use middle::trans::type_of::*;
2828
use middle::ty;
2929
use middle::typeck;
3030
use util::common::indenter;
31-
use util::ppaux::{Repr, ty_to_str};
31+
use util::ppaux::Repr;
3232

3333
use middle::trans::type_::Type;
3434

3535
use core::vec;
3636
use syntax::ast_map::{path, path_mod, path_name};
3737
use syntax::ast_util;
3838
use syntax::{ast, ast_map};
39-
use syntax::parse::token;
4039

4140
/**
4241
The main "translation" pass for methods. Generates code
@@ -755,10 +754,9 @@ pub fn make_vtable(ccx: &mut CrateContext,
755754
components.push(ptr)
756755
}
757756

758-
let name = fmt!("%s_vtable_%u", ty_to_str(ccx.tcx, tydesc.ty), token::gensym("vtable"));
759-
760757
let tbl = C_struct(components);
761-
let vt_gvar = do name.as_c_str |buf| {
758+
let vtable = ccx.sess.str_of(gensym_name("vtable"));
759+
let vt_gvar = do vtable.as_c_str |buf| {
762760
llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf)
763761
};
764762
llvm::LLVMSetInitializer(vt_gvar, tbl);

0 commit comments

Comments
 (0)