From d9eb756cbfdd0f4388bb7bd203d8d43761ff7942 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Wed, 24 Aug 2016 19:29:15 +0300 Subject: [PATCH] Wrapping and attempt at LLVM 3.7 compat This commit includes manual merge conflict resolution changes from a rebase by @est31. --- src/libcore/num/wrapping.rs | 2 ++ src/librustc_llvm/ffi.rs | 1 - src/librustc_trans/type_.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index 50d64838a5c0..b3c2c25551e0 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -298,6 +298,8 @@ macro_rules! wrapping_impl { } wrapping_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 } +#[cfg(not(stage0))] +wrapping_impl! { u128 i128 } mod shift_max { #![allow(non_upper_case_globals)] diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs index efb06bdb73e3..acf2bd50847c 100644 --- a/src/librustc_llvm/ffi.rs +++ b/src/librustc_llvm/ffi.rs @@ -508,7 +508,6 @@ extern "C" { pub fn LLVMInt16TypeInContext(C: ContextRef) -> TypeRef; pub fn LLVMInt32TypeInContext(C: ContextRef) -> TypeRef; pub fn LLVMInt64TypeInContext(C: ContextRef) -> TypeRef; - pub fn LLVMInt128TypeInContext(C: ContextRef) -> TypeRef; pub fn LLVMIntTypeInContext(C: ContextRef, NumBits: c_uint) -> TypeRef; pub fn LLVMGetIntTypeWidth(IntegerTy: TypeRef) -> c_uint; diff --git a/src/librustc_trans/type_.rs b/src/librustc_trans/type_.rs index e8d8db2956b8..5e4fe015d767 100644 --- a/src/librustc_trans/type_.rs +++ b/src/librustc_trans/type_.rs @@ -95,7 +95,7 @@ impl Type { } pub fn i128(ccx: &CrateContext) -> Type { - ty!(llvm::LLVMInt128TypeInContext(ccx.llcx())) + ty!(llvm::LLVMIntTypeInContext(ccx.llcx(), 128)) } // Creates an integer type with the given number of bits, e.g. i24