Skip to content

Commit 0032162

Browse files
committed
---
yaml --- r: 6332 b: refs/heads/master c: 834b687 h: refs/heads/master v: v3
1 parent 6f65d61 commit 0032162

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 938b23e228f4fd313973190f8f78163476cc4a3f
2+
refs/heads/master: 834b6879ea89135d60b3903755589e14f816449a

trunk/src/comp/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ native mod llvm {
865865
fn LLVMRustParseBitcode(MemBuf: MemoryBufferRef) -> ModuleRef;
866866

867867
/** FiXME: Hacky adaptor for lack of ULongLong in FFI: */
868-
fn LLVMRustConstSmallInt(IntTy: TypeRef, N: uint, SignExtend: Bool) ->
868+
fn LLVMRustConstInt(IntTy: TypeRef, N_hi: uint, N_lo: uint, SignExtend: Bool) ->
869869
ValueRef;
870870

871871
fn LLVMRustAddPrintModulePass(PM: PassManagerRef, M: ModuleRef,

trunk/src/comp/middle/trans_common.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,9 @@ fn T_opaque_chan_ptr() -> TypeRef { ret T_ptr(T_i8()); }
725725
fn C_null(t: TypeRef) -> ValueRef { ret llvm::LLVMConstNull(t); }
726726

727727
fn C_integral(t: TypeRef, u: u64, sign_extend: Bool) -> ValueRef {
728-
ret llvm::LLVMConstInt(t, u, sign_extend);
728+
let u_hi = (u >> 32u64) as uint;
729+
let u_lo = u as uint;
730+
ret llvm::LLVMRustConstInt(t, u_hi, u_lo, sign_extend);
729731
}
730732

731733
fn C_float(cx: @crate_ctxt, s: str) -> ValueRef {

trunk/src/rustllvm/RustWrapper.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ extern "C" LLVMValueRef LLVMRustConstSmallInt(LLVMTypeRef IntTy, unsigned N,
126126
return LLVMConstInt(IntTy, (unsigned long long)N, SignExtend);
127127
}
128128

129+
extern "C" LLVMValueRef LLVMRustConstInt(LLVMTypeRef IntTy,
130+
unsigned N_hi,
131+
unsigned N_lo,
132+
LLVMBool SignExtend) {
133+
unsigned long long N = N_hi;
134+
N <<= 32;
135+
N |= N_lo;
136+
return LLVMConstInt(IntTy, N, SignExtend);
137+
}
138+
129139
extern bool llvm::TimePassesIsEnabled;
130140
extern "C" void LLVMRustEnableTimePasses() {
131141
TimePassesIsEnabled = true;

trunk/src/rustllvm/rustllvm.def.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LLVMRustWriteOutputFile
44
LLVMRustGetLastError
55
LLVMRustGetHostTriple
66
LLVMRustConstSmallInt
7+
LLVMRustConstInt
78
LLVMRustParseBitcode
89
LLVMRustPrintPassTimings
910
LLVMRustEnableSegmentedStacks

0 commit comments

Comments
 (0)