Skip to content

fix android breakage #7480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/libextra/ebml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@ pub mod reader {
use core::cast::transmute;
use core::int;
use core::io;
use core::option::{None, Option, Some};

#[cfg(target_arch = "x86")]
#[cfg(target_arch = "x86_64")]
use core::option::{None, Option, Some};
use core::ptr::offset;

#[cfg(target_arch = "x86")]
#[cfg(target_arch = "x86_64")]
use core::unstable::intrinsics::bswap32;

// ebml reading
Expand Down
8 changes: 3 additions & 5 deletions src/librustc/middle/trans/meth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ 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;

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
Expand Down Expand Up @@ -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);
Expand Down