about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoung-il Choi <duddlf.choi@samsung.com>2013-06-29 14:07:24 +0900
committerDaniel Micay <danielmicay@gmail.com>2013-06-29 01:22:35 -0400
commit21cc0ccea10bb9d1b83612d26c8e62d06fe365a1 (patch)
tree7ec12306e909bde2ee70fa0b624809d2290f92c8
parent51beba6cf91ef8fcc06a32482c78bfc59b37bd73 (diff)
downloadrust-21cc0ccea10bb9d1b83612d26c8e62d06fe365a1.tar.gz
rust-21cc0ccea10bb9d1b83612d26c8e62d06fe365a1.zip
librustc: fix #7467 for android
-rw-r--r--src/librustc/middle/trans/meth.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs
index fc0c9c06c45..7d6a5b5fef9 100644
--- a/src/librustc/middle/trans/meth.rs
+++ b/src/librustc/middle/trans/meth.rs
@@ -28,7 +28,7 @@ use middle::trans::type_of::*;
 use middle::ty;
 use middle::typeck;
 use util::common::indenter;
-use util::ppaux::{Repr, ty_to_str};
+use util::ppaux::Repr;
 
 use middle::trans::type_::Type;
 
@@ -36,7 +36,6 @@ use core::vec;
 use syntax::ast_map::{path, path_mod, path_name};
 use syntax::ast_util;
 use syntax::{ast, ast_map};
-use syntax::parse::token;
 
 /**
 The main "translation" pass for methods.  Generates code
@@ -755,10 +754,9 @@ pub fn make_vtable(ccx: &mut CrateContext,
             components.push(ptr)
         }
 
-        let name = fmt!("%s_vtable_%u", ty_to_str(ccx.tcx, tydesc.ty), token::gensym("vtable"));
-
         let tbl = C_struct(components);
-        let vt_gvar = do name.as_c_str |buf| {
+        let vtable = ccx.sess.str_of(gensym_name("vtable"));
+        let vt_gvar = do vtable.as_c_str |buf| {
             llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf)
         };
         llvm::LLVMSetInitializer(vt_gvar, tbl);