diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2024-07-02 09:54:01 -0400 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2024-07-02 12:28:25 -0400 |
| commit | cd014cda8c09afd88f6a9b8d75043c1d95bee734 (patch) | |
| tree | 8be418ce05f75c1cb617e6c389b433d8e0e4a4eb | |
| parent | 606196b0cf901d02a19bc67f0c14047991eaed2a (diff) | |
| download | rust-cd014cda8c09afd88f6a9b8d75043c1d95bee734.tar.gz rust-cd014cda8c09afd88f6a9b8d75043c1d95bee734.zip | |
Replace the type of global variables instead of replacing them
| -rw-r--r-- | Cargo.lock | 4 | ||||
| -rw-r--r-- | libgccjit.version | 2 | ||||
| -rw-r--r-- | src/consts.rs | 10 |
3 files changed, 5 insertions, 11 deletions
diff --git a/Cargo.lock b/Cargo.lock index ba6633bc2dc..cd693835ded 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ dependencies = [ [[package]] name = "gccjit" version = "2.0.0" -source = "git+https://github.com/rust-lang/gccjit.rs#f1545d7c2c13e42d78eaac8032d49ab8f7d43b6e" +source = "git+https://github.com/rust-lang/gccjit.rs#328cb1b414f67dfa15162ba7a55ed01931f1b219" dependencies = [ "gccjit_sys", ] @@ -88,7 +88,7 @@ dependencies = [ [[package]] name = "gccjit_sys" version = "0.1.0" -source = "git+https://github.com/rust-lang/gccjit.rs#f1545d7c2c13e42d78eaac8032d49ab8f7d43b6e" +source = "git+https://github.com/rust-lang/gccjit.rs#328cb1b414f67dfa15162ba7a55ed01931f1b219" dependencies = [ "libc", ] diff --git a/libgccjit.version b/libgccjit.version index 71a61a4b873..23ca7f02215 100644 --- a/libgccjit.version +++ b/libgccjit.version @@ -1 +1 @@ -272d0ccced960394fe6ff2b40b01610208cb4940 +341be3b7d7ac6976cfed8ed59da3573c040d0776 diff --git a/src/consts.rs b/src/consts.rs index 93c23440c57..50f3a4e0402 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -82,17 +82,11 @@ impl<'gcc, 'tcx> StaticMethods for CodegenCx<'gcc, 'tcx> { }; let is_thread_local = attrs.flags.contains(CodegenFnAttrFlags::THREAD_LOCAL); - let mut global = self.get_static_inner(def_id, val_llty); + let global = self.get_static_inner(def_id, val_llty); #[cfg(feature = "master")] if global.to_rvalue().get_type() != val_llty { - let instance = Instance::mono(self.tcx, def_id); - self.instances.borrow_mut().remove(&instance); - - global.remove(); - let name = self.tcx.symbol_name(instance).name; - self.globals.borrow_mut().remove(name); - global = self.get_static_inner(def_id, val_llty); + global.to_rvalue().set_type(val_llty); } set_global_alignment(self, global, alloc.align); |
