const_int sign_extend
This commit is contained in:
parent
ec1ee223a0
commit
fe851f7ccd
|
@ -114,8 +114,9 @@ impl<'ctx, N: IntKind<'ctx>> Int<'ctx, N> {
|
||||||
generator: &mut G,
|
generator: &mut G,
|
||||||
ctx: &'ctx Context,
|
ctx: &'ctx Context,
|
||||||
value: u64,
|
value: u64,
|
||||||
|
sign_extend: bool,
|
||||||
) -> Instance<'ctx, Self> {
|
) -> Instance<'ctx, Self> {
|
||||||
let value = self.llvm_type(generator, ctx).const_int(value, false);
|
let value = self.llvm_type(generator, ctx).const_int(value, sign_extend);
|
||||||
unsafe { self.believe_value(value) }
|
unsafe { self.believe_value(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ impl<'ctx, N: IntKind<'ctx>> Int<'ctx, N> {
|
||||||
generator: &mut G,
|
generator: &mut G,
|
||||||
ctx: &'ctx Context,
|
ctx: &'ctx Context,
|
||||||
) -> Instance<'ctx, Self> {
|
) -> Instance<'ctx, Self> {
|
||||||
self.const_int(generator, ctx, 1)
|
self.const_int(generator, ctx, 1, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn const_all_ones<G: CodeGenerator + ?Sized>(
|
pub fn const_all_ones<G: CodeGenerator + ?Sized>(
|
||||||
|
@ -283,7 +284,7 @@ impl<'ctx> Int<'ctx, Bool> {
|
||||||
generator: &mut G,
|
generator: &mut G,
|
||||||
ctx: &'ctx Context,
|
ctx: &'ctx Context,
|
||||||
) -> Instance<'ctx, Self> {
|
) -> Instance<'ctx, Self> {
|
||||||
self.const_int(generator, ctx, 0)
|
self.const_int(generator, ctx, 0, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -292,7 +293,7 @@ impl<'ctx> Int<'ctx, Bool> {
|
||||||
generator: &mut G,
|
generator: &mut G,
|
||||||
ctx: &'ctx Context,
|
ctx: &'ctx Context,
|
||||||
) -> Instance<'ctx, Self> {
|
) -> Instance<'ctx, Self> {
|
||||||
self.const_int(generator, ctx, 1)
|
self.const_int(generator, ctx, 1, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue