[[package]]
name = "gccjit"
version = "1.0.0"
-source = "git+https://github.com/antoyo/gccjit.rs#0672b78d162d65b6f36ea4062947253affe9fdef"
+source = "git+https://github.com/antoyo/gccjit.rs#e68fce53af18dce4d40e6b7090f881ff86a2e892"
dependencies = [
"gccjit_sys",
]
[[package]]
name = "gccjit_sys"
version = "0.0.1"
-source = "git+https://github.com/antoyo/gccjit.rs#0672b78d162d65b6f36ea4062947253affe9fdef"
+source = "git+https://github.com/antoyo/gccjit.rs#e68fce53af18dce4d40e6b7090f881ff86a2e892"
dependencies = [
"libc 0.1.12",
]
#[test]
fn cell_allows_array_cycle() {
-diff --git a/library/core/tests/slice.rs b/library/core/tests/slice.rs
-index 3e00e0a..8e5663b 100644
---- a/library/core/tests/slice.rs
-+++ b/library/core/tests/slice.rs
-@@ -2108,6 +2108,7 @@ fn test_copy_within_panics_src_out_of_bounds() {
- bytes.copy_within(usize::MAX..=usize::MAX, 0);
- }
-
-+/*
- #[test]
- fn test_is_sorted() {
- let empty: [i32; 0] = [];
-@@ -2122,6 +2123,7 @@ fn test_is_sorted() {
- assert!(!["c", "bb", "aaa"].is_sorted());
- assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
- }
-+*/
-
- #[test]
- fn test_slice_run_destructors() {
-- 2.21.0 (Apple Git-122)
// following:
for (value, variable) in &*self.const_globals.borrow() {
if format!("{:?}", value) == format!("{:?}", cv) {
- // TODO(antoyo): upgrade alignment.
+ if let Some(global_variable) = self.global_lvalues.borrow().get(variable) {
+ let alignment = align.bits() as i32;
+ if alignment > global_variable.get_alignment() {
+ global_variable.set_alignment(alignment);
+ }
+ }
return *variable;
}
}
// globally.
global.global_set_initializer_rvalue(cv);
// TODO(antoyo): set unnamed address.
- global.get_address(None)
+ let rvalue = global.get_address(None);
+ self.global_lvalues.borrow_mut().insert(rvalue, global);
+ rvalue
}
pub fn get_static(&self, def_id: DefId) -> LValue<'gcc> {
/// Cache of emitted const globals (value -> global)
pub const_globals: RefCell<FxHashMap<RValue<'gcc>, RValue<'gcc>>>,
+ /// Map from the address of a global variable (rvalue) to the global variable itself (lvalue).
+ /// TODO(antoyo): remove when the rustc API is fixed.
+ pub global_lvalues: RefCell<FxHashMap<RValue<'gcc>, LValue<'gcc>>>,
/// Cache of constant strings,
pub const_cstr_cache: RefCell<FxHashMap<Symbol, LValue<'gcc>>>,
function_instances: Default::default(),
vtables: Default::default(),
const_globals: Default::default(),
+ global_lvalues: Default::default(),
const_cstr_cache: Default::default(),
globals: Default::default(),
scalar_types: Default::default(),