Annotate or fix FIXMEs in LLVM bindings and metadata code
Fixed up a few FIXMEs in lib/llvm to use more descriptive data
types. Covered FIXMEs in metadata::{creader, csearch, decoder} and
one in encoder.
This commit is contained in:
parent
37abcda42b
commit
cf2fc2c34e
10 changed files with 84 additions and 74 deletions
|
|
@ -39,6 +39,7 @@ import link::{mangle_internal_name_by_type_only,
|
|||
mangle_internal_name_by_path_and_seq,
|
||||
mangle_exported_name};
|
||||
import metadata::{csearch, cstore, encoder};
|
||||
import metadata::common::link_meta;
|
||||
import util::ppaux::{ty_to_str, ty_to_short_str};
|
||||
|
||||
import common::*;
|
||||
|
|
@ -5150,7 +5151,7 @@ fn create_module_map(ccx: @crate_ctxt) -> ValueRef {
|
|||
}
|
||||
|
||||
|
||||
fn decl_crate_map(sess: session::session, mapmeta: encoder::link_meta,
|
||||
fn decl_crate_map(sess: session::session, mapmeta: link_meta,
|
||||
llmod: ModuleRef) -> ValueRef {
|
||||
let targ_cfg = sess.targ_cfg;
|
||||
let int_type = T_int(targ_cfg);
|
||||
|
|
@ -5274,7 +5275,7 @@ fn write_abi_version(ccx: @crate_ctxt) {
|
|||
fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
|
||||
output: str, emap: resolve::exp_map,
|
||||
maps: astencode::maps)
|
||||
-> (ModuleRef, encoder::link_meta) {
|
||||
-> (ModuleRef, link_meta) {
|
||||
let sha = std::sha1::sha1();
|
||||
let link_meta = link::build_link_meta(sess, *crate, output, sha);
|
||||
let reachable = reachable::find_reachable(crate.node.module, emap, tcx,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import syntax::codemap;
|
|||
import codemap::span;
|
||||
import lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
|
||||
import lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False,
|
||||
CallConv};
|
||||
CallConv, TypeKind};
|
||||
import common::*;
|
||||
|
||||
fn B(cx: block) -> BuilderRef {
|
||||
|
|
@ -399,7 +399,7 @@ fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
|
|||
let ccx = cx.fcx.ccx;
|
||||
if cx.unreachable {
|
||||
let ty = val_ty(PointerVal);
|
||||
let eltty = if llvm::LLVMGetTypeKind(ty) == 11 as c_int {
|
||||
let eltty = if llvm::LLVMGetTypeKind(ty) == lib::llvm::Array {
|
||||
llvm::LLVMGetElementType(ty) } else { ccx.int_type };
|
||||
ret llvm::LLVMGetUndef(eltty);
|
||||
}
|
||||
|
|
@ -632,7 +632,7 @@ fn AddIncomingToPhi(phi: ValueRef, val: ValueRef, bb: BasicBlockRef) {
|
|||
fn _UndefReturn(cx: block, Fn: ValueRef) -> ValueRef {
|
||||
let ccx = cx.fcx.ccx;
|
||||
let ty = val_ty(Fn);
|
||||
let retty = if llvm::LLVMGetTypeKind(ty) == 8 as c_int {
|
||||
let retty = if llvm::LLVMGetTypeKind(ty) == lib::llvm::Integer {
|
||||
llvm::LLVMGetReturnType(ty) } else { ccx.int_type };
|
||||
count_insn(cx, "");
|
||||
ret llvm::LLVMGetUndef(retty);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ import lib::llvm::{llvm, target_data, type_names, associate_type,
|
|||
name_has_type};
|
||||
import lib::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef, BuilderRef};
|
||||
import lib::llvm::{True, False, Bool};
|
||||
import metadata::{csearch, encoder};
|
||||
import metadata::{csearch};
|
||||
import metadata::common::link_meta;
|
||||
import ast_map::path;
|
||||
import util::ppaux::ty_to_str;
|
||||
|
||||
|
|
@ -77,7 +78,7 @@ type crate_ctxt = {
|
|||
reachable: reachable::map,
|
||||
item_symbols: hashmap<ast::node_id, str>,
|
||||
mut main_fn: option<ValueRef>,
|
||||
link_meta: encoder::link_meta,
|
||||
link_meta: link_meta,
|
||||
enum_sizes: hashmap<ty::t, uint>,
|
||||
discrims: hashmap<ast::def_id, ValueRef>,
|
||||
discrim_symbols: hashmap<ast::node_id, str>,
|
||||
|
|
@ -749,9 +750,7 @@ fn T_opaque_chan_ptr() -> TypeRef { ret T_ptr(T_i8()); }
|
|||
fn C_null(t: TypeRef) -> ValueRef { ret llvm::LLVMConstNull(t); }
|
||||
|
||||
fn C_integral(t: TypeRef, u: u64, sign_extend: Bool) -> ValueRef {
|
||||
let u_hi = (u >> 32u64) as c_uint;
|
||||
let u_lo = u as c_uint;
|
||||
ret llvm::LLVMRustConstInt(t, u_hi, u_lo, sign_extend);
|
||||
ret llvm::LLVMConstInt(t, u, sign_extend);
|
||||
}
|
||||
|
||||
fn C_floating(s: str, t: TypeRef) -> ValueRef {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue