Skip to content

Commit a049344

Browse files
committed
Switch to new_array_type_u64
1 parent fb32a3f commit a049344

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "3.2.0"
59+
version = "3.3.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "ef03c8ae23826a0755b980999a553a262c61f2f585245e647192d95bf09eee79"
61+
checksum = "26b73d18b642ce16378af78f89664841d7eeafa113682ff5d14573424eb0232a"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "1.2.0"
68+
version = "1.3.0"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "0ff511da413e4a5da6f09607748395ba37525e01ba7d322cbec3efc43095dd60"
70+
checksum = "ee689456c013616942d5aef9a84d613cefcc3b335340d036f3650fc1a7459e15"
7171
dependencies = [
7272
"libc",
7373
]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ default = ["master"]
2424
[dependencies]
2525
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
2626
tempfile = "3.20"
27-
gccjit = { version = "3.2.0", features = ["dlopen"] }
27+
gccjit = { version = "3.3.0", features = ["dlopen"] }
2828
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }
2929

3030
# Local copy.

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
15031503
let element_type = vector_type.get_element_type();
15041504
let vec_num_units = vector_type.get_num_units();
15051505
let array_type =
1506-
self.context.new_array_type(self.location, element_type, vec_num_units as u64);
1506+
self.context.new_array_type_u64(self.location, element_type, vec_num_units as u64);
15071507
let array = self.context.new_bitcast(self.location, vec, array_type).to_rvalue();
15081508
self.context.new_array_access(self.location, array, idx).to_rvalue()
15091509
}

src/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) ->
5555
0 => {
5656
let context = &cx.context;
5757
let byte_type = context.new_type::<u64>();
58-
let typ = context.new_array_type(None, byte_type, bytes.len() as u64 / 8);
58+
let typ = context.new_array_type_u64(None, byte_type, bytes.len() as u64 / 8);
5959
let elements: Vec<_> = bytes
6060
.chunks_exact(8)
6161
.map(|arr| {
@@ -76,7 +76,7 @@ pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) ->
7676
4 => {
7777
let context = &cx.context;
7878
let byte_type = context.new_type::<u32>();
79-
let typ = context.new_array_type(None, byte_type, bytes.len() as u64 / 4);
79+
let typ = context.new_array_type_u64(None, byte_type, bytes.len() as u64 / 4);
8080
let elements: Vec<_> = bytes
8181
.chunks_exact(4)
8282
.map(|arr| {
@@ -95,7 +95,7 @@ pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) ->
9595
_ => {
9696
let context = cx.context;
9797
let byte_type = context.new_type::<u8>();
98-
let typ = context.new_array_type(None, byte_type, bytes.len() as u64);
98+
let typ = context.new_array_type_u64(None, byte_type, bytes.len() as u64);
9999
let elements: Vec<_> = bytes
100100
.iter()
101101
.map(|&byte| context.new_rvalue_from_int(byte_type, byte as i32))

src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
201201

202202
// TODO(antoyo): re-enable the alignment when libgccjit fixed the issue in
203203
// gcc_jit_context_new_array_constructor (it should not use reinterpret_cast).
204-
let i128_type = context.new_array_type(None, i64_type, 2)/*.get_aligned(i128_align)*/;
205-
let u128_type = context.new_array_type(None, u64_type, 2)/*.get_aligned(u128_align)*/;
204+
let i128_type = context.new_array_type_u64(None, i64_type, 2)/*.get_aligned(i128_align)*/;
205+
let u128_type = context.new_array_type_u64(None, u64_type, 2)/*.get_aligned(u128_align)*/;
206206
(i128_type, u128_type)
207207
};
208208

src/intrinsic/llvm.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,15 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(
585585
"__builtin_ia32_encodekey128_u32" => {
586586
let mut new_args = args.to_vec();
587587
let m128i = builder.context.new_vector_type(builder.i64_type, 2);
588-
let array_type = builder.context.new_array_type(None, m128i, 6);
588+
let array_type = builder.context.new_array_type_u64(None, m128i, 6);
589589
let result = builder.current_func().new_local(None, array_type, "result");
590590
new_args.push(result.get_address(None));
591591
args = new_args.into();
592592
}
593593
"__builtin_ia32_encodekey256_u32" => {
594594
let mut new_args = args.to_vec();
595595
let m128i = builder.context.new_vector_type(builder.i64_type, 2);
596-
let array_type = builder.context.new_array_type(None, m128i, 7);
596+
let array_type = builder.context.new_array_type_u64(None, m128i, 7);
597597
let result = builder.current_func().new_local(None, array_type, "result");
598598
new_args.push(result.get_address(None));
599599
args = new_args.into();
@@ -620,7 +620,7 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(
620620
let first_value = old_args.swap_remove(0);
621621

622622
let element_type = first_value.get_type();
623-
let array_type = builder.context.new_array_type(None, element_type, 8);
623+
let array_type = builder.context.new_array_type_u64(None, element_type, 8);
624624
let result = builder.current_func().new_local(None, array_type, "result");
625625
new_args.push(result.get_address(None));
626626

@@ -869,7 +869,7 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>(
869869
builder.llbb().add_assignment(None, field1, return_value);
870870
let field2 = result.access_field(None, field2);
871871
let field2_type = field2.to_rvalue().get_type();
872-
let array_type = builder.context.new_array_type(None, field2_type, 6);
872+
let array_type = builder.context.new_array_type_u64(None, field2_type, 6);
873873
let ptr = builder.context.new_cast(None, args[2], array_type.make_pointer());
874874
let field2_ptr =
875875
builder.context.new_cast(None, field2.get_address(None), array_type.make_pointer());
@@ -891,7 +891,7 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>(
891891
builder.llbb().add_assignment(None, field1, return_value);
892892
let field2 = result.access_field(None, field2);
893893
let field2_type = field2.to_rvalue().get_type();
894-
let array_type = builder.context.new_array_type(None, field2_type, 7);
894+
let array_type = builder.context.new_array_type_u64(None, field2_type, 7);
895895
let ptr = builder.context.new_cast(None, args[3], array_type.make_pointer());
896896
let field2_ptr =
897897
builder.context.new_cast(None, field2.get_address(None), array_type.make_pointer());
@@ -937,7 +937,7 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>(
937937
builder.llbb().add_assignment(None, field1, return_value);
938938
let field2 = result.access_field(None, field2);
939939
let field2_type = field2.to_rvalue().get_type();
940-
let array_type = builder.context.new_array_type(None, field2_type, 8);
940+
let array_type = builder.context.new_array_type_u64(None, field2_type, 8);
941941
let ptr = builder.context.new_cast(None, args[0], array_type.make_pointer());
942942
let field2_ptr =
943943
builder.context.new_cast(None, field2.get_address(None), array_type.make_pointer());

src/type_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl<'gcc, 'tcx> BaseTypeCodegenMethods for CodegenCx<'gcc, 'tcx> {
311311
len = 0;
312312
}
313313

314-
self.context.new_array_type(None, ty, len)
314+
self.context.new_array_type_u64(None, ty, len)
315315
}
316316
}
317317

0 commit comments

Comments
 (0)