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:
Tim Chevalier 2012-05-17 16:17:11 -07:00
parent 37abcda42b
commit cf2fc2c34e
10 changed files with 84 additions and 74 deletions

View File

@ -6,11 +6,13 @@ import syntax::attr;
import middle::ty; import middle::ty;
import metadata::{encoder, cstore}; import metadata::{encoder, cstore};
import middle::trans::common::crate_ctxt; import middle::trans::common::crate_ctxt;
import metadata::common::link_meta;
import std::map::hashmap; import std::map::hashmap;
import std::sha1::sha1; import std::sha1::sha1;
import syntax::ast; import syntax::ast;
import syntax::print::pprust; import syntax::print::pprust;
import lib::llvm::{ModuleRef, mk_pass_manager, mk_target_data, True, False}; import lib::llvm::{ModuleRef, mk_pass_manager, mk_target_data, True, False,
FileType};
import util::filesearch; import util::filesearch;
import middle::ast_map::{path, path_mod, path_name}; import middle::ast_map::{path, path_mod, path_name};
@ -125,8 +127,6 @@ mod write {
} }
if opts.verify { llvm::LLVMAddVerifierPass(pm.llpm); } if opts.verify { llvm::LLVMAddVerifierPass(pm.llpm); }
if is_object_or_assembly_or_exe(opts.output_type) { if is_object_or_assembly_or_exe(opts.output_type) {
let LLVMAssemblyFile = 0 as c_int;
let LLVMObjectFile = 1 as c_int;
let LLVMOptNone = 0 as c_int; // -O0 let LLVMOptNone = 0 as c_int; // -O0
let LLVMOptLess = 1 as c_int; // -O1 let LLVMOptLess = 1 as c_int; // -O1
let LLVMOptDefault = 2 as c_int; // -O2, -Os let LLVMOptDefault = 2 as c_int; // -O2, -Os
@ -143,8 +143,8 @@ mod write {
let mut FileType; let mut FileType;
if opts.output_type == output_type_object || if opts.output_type == output_type_object ||
opts.output_type == output_type_exe { opts.output_type == output_type_exe {
FileType = LLVMObjectFile; FileType = lib::llvm::ObjectFile;
} else { FileType = LLVMAssemblyFile; } } else { FileType = lib::llvm::AssemblyFile; }
// Write optimized bitcode if --save-temps was on. // Write optimized bitcode if --save-temps was on.
if opts.save_temps { if opts.save_temps {
@ -169,7 +169,7 @@ mod write {
llmod, llmod,
buf_t, buf_t,
buf_o, buf_o,
LLVMAssemblyFile, lib::llvm::AssemblyFile as c_uint,
CodeGenOptLevel, CodeGenOptLevel,
true)})}); true)})});
} }
@ -189,7 +189,7 @@ mod write {
llmod, llmod,
buf_t, buf_t,
buf_o, buf_o,
LLVMObjectFile, lib::llvm::ObjectFile as c_uint,
CodeGenOptLevel, CodeGenOptLevel,
true)})}); true)})});
} }
@ -207,7 +207,7 @@ mod write {
llmod, llmod,
buf_t, buf_t,
buf_o, buf_o,
FileType, FileType as c_uint,
CodeGenOptLevel, CodeGenOptLevel,
true)})}); true)})});
} }
@ -288,7 +288,7 @@ mod write {
*/ */
fn build_link_meta(sess: session, c: ast::crate, output: str, fn build_link_meta(sess: session, c: ast::crate, output: str,
sha: sha1) -> encoder::link_meta { sha: sha1) -> link_meta {
type provided_metas = type provided_metas =
{name: option<str>, {name: option<str>,
@ -412,7 +412,7 @@ fn truncated_sha1_result(sha: sha1) -> str unsafe {
// This calculates STH for a symbol, as defined above // This calculates STH for a symbol, as defined above
fn symbol_hash(tcx: ty::ctxt, sha: sha1, t: ty::t, fn symbol_hash(tcx: ty::ctxt, sha: sha1, t: ty::t,
link_meta: encoder::link_meta) -> str { link_meta: link_meta) -> str {
// NB: do *not* use abbrevs here as we want the symbol names // NB: do *not* use abbrevs here as we want the symbol names
// to be independent of one another in the crate. // to be independent of one another in the crate.
@ -525,7 +525,7 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
fn link_binary(sess: session, fn link_binary(sess: session,
obj_filename: str, obj_filename: str,
out_filename: str, out_filename: str,
lm: encoder::link_meta) { lm: link_meta) {
// Converts a library file name into a cc -l argument // Converts a library file name into a cc -l argument
fn unlib(config: @session::config, filename: str) -> str unsafe { fn unlib(config: @session::config, filename: str) -> str unsafe {
let rmlib = fn@(filename: str) -> str { let rmlib = fn@(filename: str) -> str {

View File

@ -4,8 +4,8 @@ import libc::{c_char, c_int, c_uint, c_longlong, c_ulonglong};
type Opcode = u32; type Opcode = u32;
type Bool = c_uint; type Bool = c_uint;
const True: Bool = 1u32; // FIXME: should be '1 as Bool' const True: Bool = 1 as Bool;
const False: Bool = 0u32; const False: Bool = 0 as Bool;
// Consts for the LLVM CallConv type, pre-cast to uint. // Consts for the LLVM CallConv type, pre-cast to uint.
@ -75,9 +75,7 @@ enum Attribute {
NonLazyBindAttribute = 2147483648, NonLazyBindAttribute = 2147483648,
} }
// Consts for the LLVM IntPredicate type, pre-cast to uint. // enum for the LLVM IntPredicate type
// FIXME: as above.
enum IntPredicate { enum IntPredicate {
IntEQ = 32, IntEQ = 32,
IntNE = 33, IntNE = 33,
@ -91,9 +89,7 @@ enum IntPredicate {
IntSLE = 41, IntSLE = 41,
} }
// Consts for the LLVM RealPredicate type, pre-case to uint. // enum for the LLVM RealPredicate type
// FIXME: as above.
enum RealPredicate { enum RealPredicate {
RealOEQ = 1, RealOEQ = 1,
RealOGT = 2, RealOGT = 2,
@ -111,6 +107,34 @@ enum RealPredicate {
RealUNE = 14, RealUNE = 14,
} }
// enum for the LLVM TypeKind type - must stay in sync with the def of
// LLVMTypeKind in llvm/include/llvm-c/Core.h
enum TypeKind {
Void = 0,
Half = 1,
Float = 2,
Double = 3,
X86_FP80 = 4,
FP128 = 5,
PPC_FP128 = 6,
Label = 7,
Integer = 8,
Function = 9,
Struct = 10,
Array = 11,
Pointer = 12,
Vector = 13,
Metadata = 14,
X86_MMX = 15
}
// FIXME: Not used right now, but will be once #2334 is fixed
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
enum FileType {
AssemblyFile = 0,
ObjectFile = 1
}
// Opaque pointer types // Opaque pointer types
enum Module_opaque {} enum Module_opaque {}
type ModuleRef = *Module_opaque; type ModuleRef = *Module_opaque;
@ -171,12 +195,7 @@ native mod llvm {
fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *c_char); fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *c_char);
/** See llvm::LLVMTypeKind::getTypeID. */ /** See llvm::LLVMTypeKind::getTypeID. */
fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
// FIXME: returning int rather than TypeKind because
// we directly inspect the values, and casting from
// a native doesn't work yet (only *to* a native).
fn LLVMGetTypeKind(Ty: TypeRef) -> c_int;
/** See llvm::LLVMType::getContext. */ /** See llvm::LLVMType::getContext. */
fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef; fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
@ -294,9 +313,7 @@ native mod llvm {
/* Operations on scalar constants */ /* Operations on scalar constants */
fn LLVMConstInt(IntTy: TypeRef, N: c_ulonglong, SignExtend: Bool) -> fn LLVMConstInt(IntTy: TypeRef, N: c_ulonglong, SignExtend: Bool) ->
ValueRef; ValueRef;
// FIXME: radix is actually u8, but our native layer can't handle this fn LLVMConstIntOfString(IntTy: TypeRef, Text: *c_char, Radix: u8) ->
// yet. lucky for us we're little-endian. Small miracles.
fn LLVMConstIntOfString(IntTy: TypeRef, Text: *c_char, Radix: c_int) ->
ValueRef; ValueRef;
fn LLVMConstIntOfStringAndSize(IntTy: TypeRef, Text: *c_char, fn LLVMConstIntOfStringAndSize(IntTy: TypeRef, Text: *c_char,
SLen: c_uint, SLen: c_uint,
@ -764,8 +781,8 @@ native mod llvm {
/** Adds the target data to the given pass manager. The pass manager /** Adds the target data to the given pass manager. The pass manager
references the target data only weakly. */ references the target data only weakly. */
fn LLVMAddTargetData(TD: TargetDataRef, PM: PassManagerRef); fn LLVMAddTargetData(TD: TargetDataRef, PM: PassManagerRef);
/** Returns the size of a type. FIXME: rv is actually a C_Ulonglong! */ /** Returns the size of a type. */
fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint; fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_ulonglong;
fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint; fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint;
/** Returns the preferred alignment of a type. */ /** Returns the preferred alignment of a type. */
fn LLVMPreferredAlignmentOfType(TD: TargetDataRef, fn LLVMPreferredAlignmentOfType(TD: TargetDataRef,
@ -879,10 +896,11 @@ native mod llvm {
fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *c_char) -> fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *c_char) ->
MemoryBufferRef; MemoryBufferRef;
/* FIXME: The FileType is an enum.*/
fn LLVMRustWriteOutputFile(PM: PassManagerRef, M: ModuleRef, fn LLVMRustWriteOutputFile(PM: PassManagerRef, M: ModuleRef,
Triple: *c_char, Triple: *c_char,
Output: *c_char, FileType: c_int, // FIXME: When #2334 is fixed, change
// c_uint to FileType
Output: *c_char, FileType: c_uint,
OptLevel: c_int, OptLevel: c_int,
EnableSegmentedStacks: bool); EnableSegmentedStacks: bool);
@ -896,10 +914,6 @@ native mod llvm {
/** Parses LLVM asm in the given file */ /** Parses LLVM asm in the given file */
fn LLVMRustParseAssemblyFile(Filename: *c_char) -> ModuleRef; fn LLVMRustParseAssemblyFile(Filename: *c_char) -> ModuleRef;
/** FiXME: Hacky adaptor for lack of c_ulonglong in FFI: */
fn LLVMRustConstInt(IntTy: TypeRef, N_hi: c_uint, N_lo: c_uint,
SignExtend: Bool) -> ValueRef;
fn LLVMRustAddPrintModulePass(PM: PassManagerRef, M: ModuleRef, fn LLVMRustAddPrintModulePass(PM: PassManagerRef, M: ModuleRef,
Output: *c_char); Output: *c_char);
@ -970,7 +984,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
let outer = outer0 + [ty]; let outer = outer0 + [ty];
let kind: int = llvm::LLVMGetTypeKind(ty) as int; let kind = llvm::LLVMGetTypeKind(ty);
fn tys_str(names: type_names, outer: [TypeRef], tys: [TypeRef]) -> str { fn tys_str(names: type_names, outer: [TypeRef], tys: [TypeRef]) -> str {
let mut s: str = ""; let mut s: str = "";
@ -983,20 +997,18 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
} }
alt kind { alt kind {
// FIXME: more enum-as-int constants determined from Core::h; Void { ret "Void"; }
// horrible, horrible. Complete as needed. Half { ret "Half"; }
0 { ret "Void"; } Float { ret "Float"; }
1 { ret "Half"; } Double { ret "Double"; }
2 { ret "Float"; } X86_FP80 { ret "X86_FP80"; }
3 { ret "Double"; } FP128 { ret "FP128"; }
4 { ret "X86_FP80"; } PPC_FP128 { ret "PPC_FP128"; }
5 { ret "FP128"; } Label { ret "Label"; }
6 { ret "PPC_FP128"; } Integer {
7 { ret "Label"; }
8 {
ret "i" + int::str(llvm::LLVMGetIntTypeWidth(ty) as int); ret "i" + int::str(llvm::LLVMGetIntTypeWidth(ty) as int);
} }
9 { Function {
let mut s = "fn("; let mut s = "fn(";
let out_ty: TypeRef = llvm::LLVMGetReturnType(ty); let out_ty: TypeRef = llvm::LLVMGetReturnType(ty);
let n_args = llvm::LLVMCountParamTypes(ty) as uint; let n_args = llvm::LLVMCountParamTypes(ty) as uint;
@ -1009,7 +1021,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
s += type_to_str_inner(names, outer, out_ty); s += type_to_str_inner(names, outer, out_ty);
ret s; ret s;
} }
10 { Struct {
let mut s: str = "{"; let mut s: str = "{";
let n_elts = llvm::LLVMCountStructElementTypes(ty) as uint; let n_elts = llvm::LLVMCountStructElementTypes(ty) as uint;
let elts: [TypeRef] = vec::from_elem::<TypeRef>(n_elts, 0 as TypeRef); let elts: [TypeRef] = vec::from_elem::<TypeRef>(n_elts, 0 as TypeRef);
@ -1020,12 +1032,12 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
s += "}"; s += "}";
ret s; ret s;
} }
11 { Array {
let el_ty = llvm::LLVMGetElementType(ty); let el_ty = llvm::LLVMGetElementType(ty);
ret "[" + type_to_str_inner(names, outer, el_ty) + " x " + ret "[" + type_to_str_inner(names, outer, el_ty) + " x " +
uint::str(llvm::LLVMGetArrayLength(ty) as uint) + "]"; uint::str(llvm::LLVMGetArrayLength(ty) as uint) + "]";
} }
12 { Pointer {
let mut i: uint = 0u; let mut i: uint = 0u;
for outer0.each {|tout| for outer0.each {|tout|
i += 1u; i += 1u;
@ -1045,10 +1057,9 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
ret addrstr + "*" + ret addrstr + "*" +
type_to_str_inner(names, outer, llvm::LLVMGetElementType(ty)); type_to_str_inner(names, outer, llvm::LLVMGetElementType(ty));
} }
13 { ret "Vector"; } Vector { ret "Vector"; }
14 { ret "Metadata"; } Metadata { ret "Metadata"; }
15 { ret "X86_MMAX"; } X86_MMX { ret "X86_MMAX"; }
_ { #error("unknown TypeKind %d", kind as int); fail; }
} }
} }

View File

@ -132,3 +132,6 @@ fn hash_path(&&s: str) -> uint {
for str::each(s) {|ch| h = (h << 5u) + h ^ (ch as uint); } for str::each(s) {|ch| h = (h << 5u) + h ^ (ch as uint); }
ret h; ret h;
} }
type link_meta = {name: str, vers: str, extras_hash: str};

View File

@ -239,6 +239,7 @@ fn resolve_crate_deps(e: env, cdata: @[u8]) -> cstore::cnum_map {
#debug("need to load it"); #debug("need to load it");
// This is a new one so we've got to load it // This is a new one so we've got to load it
// FIXME: Need better error reporting than just a bogus span // FIXME: Need better error reporting than just a bogus span
// #2404
let fake_span = ast_util::dummy_sp(); let fake_span = ast_util::dummy_sp();
let local_cnum = let local_cnum =
resolve_crate(e, cname, cmetas, dep.hash, fake_span); resolve_crate(e, cname, cmetas, dep.hash, fake_span);

View File

@ -141,7 +141,6 @@ fn get_type(tcx: ty::ctxt, def: ast::def_id) -> ty::ty_param_bounds_and_ty {
decoder::get_type(cdata, def.node, tcx) decoder::get_type(cdata, def.node, tcx)
} }
/* FIXME: Refactor */
fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id, fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
def: ast::def_id) -> ty::ty_param_bounds_and_ty { def: ast::def_id) -> ty::ty_param_bounds_and_ty {
let cstore = tcx.sess.cstore; let cstore = tcx.sess.cstore;

View File

@ -578,8 +578,8 @@ fn get_meta_items(md: ebml::doc) -> [@ast::meta_item] {
let vd = ebml::get_doc(meta_item_doc, tag_meta_item_value); let vd = ebml::get_doc(meta_item_doc, tag_meta_item_value);
let n = str::from_bytes(ebml::doc_data(nd)); let n = str::from_bytes(ebml::doc_data(nd));
let v = str::from_bytes(ebml::doc_data(vd)); let v = str::from_bytes(ebml::doc_data(vd));
// FIXME (#611): Should be able to decode meta_name_value variants, // FIXME (#623): Should be able to decode meta_name_value variants,
// but currently they can't be encoded // but currently the encoder just drops them
items += [attr::mk_name_value_item_str(n, v)]; items += [attr::mk_name_value_item_str(n, v)];
}; };
ebml::tagged_docs(md, tag_meta_item_list) {|meta_item_doc| ebml::tagged_docs(md, tag_meta_item_list) {|meta_item_doc|

View File

@ -20,7 +20,6 @@ import std::ebml::serializer;
import syntax::ast; import syntax::ast;
import syntax::diagnostic::span_handler; import syntax::diagnostic::span_handler;
export link_meta;
export encode_parms; export encode_parms;
export encode_metadata; export encode_metadata;
export encoded_ty; export encoded_ty;
@ -33,9 +32,6 @@ export encode_ctxt;
export write_type; export write_type;
export encode_def_id; export encode_def_id;
// FIXME: This probably belongs somewhere else
type link_meta = {name: str, vers: str, extras_hash: str};
type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>; type abbrev_map = map::hashmap<ty::t, tyencode::ty_abbrev>;
type encode_inlined_item = fn@(ecx: @encode_ctxt, type encode_inlined_item = fn@(ecx: @encode_ctxt,
@ -916,7 +912,7 @@ fn encode_meta_item(ebml_w: ebml::writer, mi: meta_item) {
ebml_w.end_tag(); ebml_w.end_tag();
ebml_w.end_tag(); ebml_w.end_tag();
} }
_ {/* FIXME (#611) */ } _ {/* FIXME (#623): encode other variants */ }
} }
} }
meta_list(name, items) { meta_list(name, items) {

View File

@ -39,6 +39,7 @@ import link::{mangle_internal_name_by_type_only,
mangle_internal_name_by_path_and_seq, mangle_internal_name_by_path_and_seq,
mangle_exported_name}; mangle_exported_name};
import metadata::{csearch, cstore, encoder}; import metadata::{csearch, cstore, encoder};
import metadata::common::link_meta;
import util::ppaux::{ty_to_str, ty_to_short_str}; import util::ppaux::{ty_to_str, ty_to_short_str};
import common::*; 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 { llmod: ModuleRef) -> ValueRef {
let targ_cfg = sess.targ_cfg; let targ_cfg = sess.targ_cfg;
let int_type = T_int(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, fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
output: str, emap: resolve::exp_map, output: str, emap: resolve::exp_map,
maps: astencode::maps) maps: astencode::maps)
-> (ModuleRef, encoder::link_meta) { -> (ModuleRef, link_meta) {
let sha = std::sha1::sha1(); let sha = std::sha1::sha1();
let link_meta = link::build_link_meta(sess, *crate, output, sha); let link_meta = link::build_link_meta(sess, *crate, output, sha);
let reachable = reachable::find_reachable(crate.node.module, emap, tcx, let reachable = reachable::find_reachable(crate.node.module, emap, tcx,

View File

@ -5,7 +5,7 @@ import syntax::codemap;
import codemap::span; import codemap::span;
import lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef}; import lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
import lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False, import lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False,
CallConv}; CallConv, TypeKind};
import common::*; import common::*;
fn B(cx: block) -> BuilderRef { fn B(cx: block) -> BuilderRef {
@ -399,7 +399,7 @@ fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
let ccx = cx.fcx.ccx; let ccx = cx.fcx.ccx;
if cx.unreachable { if cx.unreachable {
let ty = val_ty(PointerVal); 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 }; llvm::LLVMGetElementType(ty) } else { ccx.int_type };
ret llvm::LLVMGetUndef(eltty); ret llvm::LLVMGetUndef(eltty);
} }
@ -632,7 +632,7 @@ fn AddIncomingToPhi(phi: ValueRef, val: ValueRef, bb: BasicBlockRef) {
fn _UndefReturn(cx: block, Fn: ValueRef) -> ValueRef { fn _UndefReturn(cx: block, Fn: ValueRef) -> ValueRef {
let ccx = cx.fcx.ccx; let ccx = cx.fcx.ccx;
let ty = val_ty(Fn); 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 }; llvm::LLVMGetReturnType(ty) } else { ccx.int_type };
count_insn(cx, ""); count_insn(cx, "");
ret llvm::LLVMGetUndef(retty); ret llvm::LLVMGetUndef(retty);

View File

@ -17,7 +17,8 @@ import lib::llvm::{llvm, target_data, type_names, associate_type,
name_has_type}; name_has_type};
import lib::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef, BuilderRef}; import lib::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef, BuilderRef};
import lib::llvm::{True, False, Bool}; import lib::llvm::{True, False, Bool};
import metadata::{csearch, encoder}; import metadata::{csearch};
import metadata::common::link_meta;
import ast_map::path; import ast_map::path;
import util::ppaux::ty_to_str; import util::ppaux::ty_to_str;
@ -77,7 +78,7 @@ type crate_ctxt = {
reachable: reachable::map, reachable: reachable::map,
item_symbols: hashmap<ast::node_id, str>, item_symbols: hashmap<ast::node_id, str>,
mut main_fn: option<ValueRef>, mut main_fn: option<ValueRef>,
link_meta: encoder::link_meta, link_meta: link_meta,
enum_sizes: hashmap<ty::t, uint>, enum_sizes: hashmap<ty::t, uint>,
discrims: hashmap<ast::def_id, ValueRef>, discrims: hashmap<ast::def_id, ValueRef>,
discrim_symbols: hashmap<ast::node_id, str>, 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_null(t: TypeRef) -> ValueRef { ret llvm::LLVMConstNull(t); }
fn C_integral(t: TypeRef, u: u64, sign_extend: Bool) -> ValueRef { fn C_integral(t: TypeRef, u: u64, sign_extend: Bool) -> ValueRef {
let u_hi = (u >> 32u64) as c_uint; ret llvm::LLVMConstInt(t, u, sign_extend);
let u_lo = u as c_uint;
ret llvm::LLVMRustConstInt(t, u_hi, u_lo, sign_extend);
} }
fn C_floating(s: str, t: TypeRef) -> ValueRef { fn C_floating(s: str, t: TypeRef) -> ValueRef {