temp workaround for failure to pass ulonglong successfully

This commit is contained in:
Niko Matsakis 2011-11-16 12:15:54 -08:00
parent 938b23e228
commit 834b6879ea
4 changed files with 15 additions and 2 deletions

View File

@ -865,7 +865,7 @@ native mod llvm {
fn LLVMRustParseBitcode(MemBuf: MemoryBufferRef) -> ModuleRef;
/** FiXME: Hacky adaptor for lack of ULongLong in FFI: */
fn LLVMRustConstSmallInt(IntTy: TypeRef, N: uint, SignExtend: Bool) ->
fn LLVMRustConstInt(IntTy: TypeRef, N_hi: uint, N_lo: uint, SignExtend: Bool) ->
ValueRef;
fn LLVMRustAddPrintModulePass(PM: PassManagerRef, M: ModuleRef,

View File

@ -725,7 +725,9 @@ 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 {
ret llvm::LLVMConstInt(t, u, sign_extend);
let u_hi = (u >> 32u64) as uint;
let u_lo = u as uint;
ret llvm::LLVMRustConstInt(t, u_hi, u_lo, sign_extend);
}
fn C_float(cx: @crate_ctxt, s: str) -> ValueRef {

View File

@ -126,6 +126,16 @@ extern "C" LLVMValueRef LLVMRustConstSmallInt(LLVMTypeRef IntTy, unsigned N,
return LLVMConstInt(IntTy, (unsigned long long)N, SignExtend);
}
extern "C" LLVMValueRef LLVMRustConstInt(LLVMTypeRef IntTy,
unsigned N_hi,
unsigned N_lo,
LLVMBool SignExtend) {
unsigned long long N = N_hi;
N <<= 32;
N |= N_lo;
return LLVMConstInt(IntTy, N, SignExtend);
}
extern bool llvm::TimePassesIsEnabled;
extern "C" void LLVMRustEnableTimePasses() {
TimePassesIsEnabled = true;

View File

@ -4,6 +4,7 @@ LLVMRustWriteOutputFile
LLVMRustGetLastError
LLVMRustGetHostTriple
LLVMRustConstSmallInt
LLVMRustConstInt
LLVMRustParseBitcode
LLVMRustPrintPassTimings
LLVMRustEnableSegmentedStacks