Skip to content

Commit a9aa553

Browse files
committed
Updated rustc version
1 parent e0797ac commit a9aa553

File tree

17 files changed

+1181
-91
lines changed

17 files changed

+1181
-91
lines changed

cilly/src/bin/linker/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ fn main() {
328328
}
329329
if !*PANIC_MANAGED_BT {
330330
if *C_MODE {
331-
cilly::v2::builtins::unwind::c_raise_exception(&mut final_assembly, &mut overrides);
331+
//cilly::v2::builtins::unwind::c_raise_exception(&mut final_assembly, &mut overrides);
332332
} else {
333-
cilly::v2::builtins::unwind::raise_exception(&mut final_assembly, &mut overrides);
333+
//cilly::v2::builtins::unwind::raise_exception(&mut final_assembly, &mut overrides);
334334
}
335335
}
336336
if !*C_MODE {

cilly/src/v2/builtins/unwind.rs

Whitespace-only changes.

rustc_codegen_clr_place/src/body.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,7 @@ pub fn place_elem_body<'tcx>(
208208
parrent_node,
209209
*index,
210210
),
211-
PlaceElem::Subtype(tpe) => {
212-
if body_ty_is_by_address(curr_type.as_ty().unwrap(), ctx) {
213-
(
214-
PlaceTy::Ty(*tpe),
215-
super::deref_op((*tpe).into(), ctx, parrent_node),
216-
)
217-
} else {
218-
(PlaceTy::Ty(*tpe), parrent_node)
219-
}
220-
}
211+
221212
PlaceElem::ConstantIndex {
222213
offset,
223214
min_length: _,

rustc_codegen_clr_place/src/get.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,7 @@ fn place_elem_get<'a>(
231231
}
232232
}
233233
}
234-
PlaceElem::Subtype(tpe) => {
235-
if body_ty_is_by_address(curr_type.as_ty().unwrap(), ctx) {
236-
super::deref_op((*tpe).into(), ctx, addr_calc)
237-
} else {
238-
addr_calc
239-
}
240-
}
234+
241235
_ => todo!("Can't handle porojection {place_elem:?} in get"),
242236
}
243237
}

rustc_codegen_clr_type/src/adt.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ pub fn field_descrptor<'tcx>(
213213
field_type,
214214
));
215215
} else if let TyKind::Coroutine(_, args) = owner_ty.kind() {
216-
let coroutine = args.as_coroutine().witness();
217-
let TyKind::CoroutineWitness(_, fields) = coroutine.kind() else {
216+
todo!();
217+
/*
218+
let coroutine = args.as_coroutine();
219+
let TyKind::CoroutineWitness(_, fields) = coroutine.kind_ty() else {
218220
panic!("corutine witness is not CoroutineWitness.");
219221
};
220222
let field_type = fields
@@ -234,7 +236,7 @@ pub fn field_descrptor<'tcx>(
234236
owner_type.as_class_ref().expect("Coroutine type invalid!"),
235237
field_name,
236238
field_type,
237-
));
239+
)); */
238240
}
239241
let (adt, subst) = as_adt(owner_ty).expect("Tried to get a field of a non ADT or tuple type!");
240242
let field = adt

rustc_codegen_clr_type/src/type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn get_type<'tcx>(ty: Ty<'tcx>, ctx: &mut MethodCompileCtx<'tcx, '_>) -> Typ
129129
}
130130
Type::ClassRef(cref)
131131
}
132-
TyKind::Dynamic(_list, _, _) => {
132+
TyKind::Dynamic(_list, _) => {
133133
let name = ctx.alloc_string("Dyn");
134134
let cref = ctx.alloc_class_ref(ClassRef::new(name, None, true, [].into()));
135135
if ctx.class_ref_to_def(cref).is_none() {

rustc_codgen_clr_operand/src/constant.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn const_slice_backer_type<'tcx>(
120120
Type::ClassRef(arr_tpe)
121121
}
122122
pub fn load_const_value<'tcx>(
123-
const_val: ConstValue<'tcx>,
123+
const_val: ConstValue,
124124
const_ty: Ty<'tcx>,
125125
ctx: &mut MethodCompileCtx<'tcx, '_>,
126126
) -> V1Node {
@@ -135,11 +135,13 @@ pub fn load_const_value<'tcx>(
135135
let tpe = ctx.type_from_cache(tpe);
136136
V1Node::uninit_val(tpe, ctx)
137137
}
138-
ConstValue::Slice { data, meta } => {
138+
ConstValue::Slice { meta,alloc_id } => {
139+
// SUS
140+
let data = ctx.tcx().global_alloc(alloc_id).unwrap_memory();
139141
let slice_type = ctx.type_from_cache(const_ty);
140142
let slice_dotnet = slice_type.as_class_ref().expect("Slice type invalid!");
141143

142-
let alloc_id = ctx.tcx().reserve_and_set_memory_alloc(data);
144+
let alloc_id = alloc_id;
143145

144146
let ptr = if meta == 0 {
145147
ctx.alloc_node(Const::USize(1 << 30))
@@ -173,7 +175,7 @@ fn load_scalar_ptr(
173175
ptr: rustc_middle::mir::interpret::Pointer,
174176
tpe: Interned<Type>,
175177
) -> Interned<CILNode> {
176-
let (alloc_id, offset) = ptr.into_parts();
178+
let (alloc_id, offset) = ptr. into_raw_parts();
177179
let global_alloc = ctx.tcx().global_alloc(alloc_id.alloc_id());
178180
let u8_ptr = ctx.nptr(Type::Int(Int::U8));
179181
let u8_ptr_ptr = ctx.nptr(u8_ptr);
@@ -255,6 +257,7 @@ fn load_scalar_ptr(
255257
);
256258
CILNode::LdFtn(ctx.alloc_methodref(mref)).into_idx(ctx)
257259
}
260+
GlobalAlloc::TypeId{..} => todo!(),
258261
GlobalAlloc::VTable(_, _) => {
259262
let (ty, polyref) = global_alloc.unwrap_vtable();
260263
get_vtable(

rustc_codgen_clr_operand/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ pub fn is_uninit<'tcx>(operand: &Operand<'tcx>, ctx: &mut MethodCompileCtx<'tcx,
6464
// ZeroSized has no data, so I guess it has no initialized data, so assiments using it could propably be safely skipped.
6565
true
6666
}
67-
ConstValue::Slice { data, .. } => {
67+
ConstValue::Slice { alloc_id,meta } => {
68+
// SUS
69+
let data = ctx.tcx().global_alloc(alloc_id).unwrap_memory();
6870
let mask = data.inner().init_mask();
6971
let mut chunks =
7072
mask.range_as_init_chunks(rustc_const_eval::interpret::AllocRange {

rustc_codgen_clr_operand/src/static_data.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
use crate::constant::static_ty;
24
use cilly::{
35
Access, Const, FnSig, Int, Interned, IntoAsmIndex, MethodDef, MethodDefIdx, MethodRef,
@@ -75,6 +77,7 @@ fn alloc_default_type(alloc_id: u64, ctx: &mut MethodCompileCtx<'_, '_>) -> Type
7577
GlobalAlloc::Function { .. } => {
7678
todo!()
7779
}
80+
GlobalAlloc::TypeId{..}=>todo!(),
7881
};
7982
let tpe = match alloc.0.0.align.bytes() {
8083
..1 => Int::U8,
@@ -141,6 +144,7 @@ pub fn add_allocation(
141144
return (ctx.load_static(field_desc));
142145
//todo!("Function/Vtable allocation.");
143146
}
147+
GlobalAlloc::TypeId{..} => todo!(),
144148
};
145149

146150
let const_allocation = const_allocation.inner();

src/assembly.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_codegen_clr_ctx::function_name;
2222
pub use rustc_codegen_clr_ctx::MethodCompileCtx;
2323
use rustc_codegen_clr_type::{adt::field_descrptor, r#type::get_type, utilis::is_zst, GetTypeExt};
2424
use rustc_codgen_clr_operand::static_data::add_static;
25-
use rustc_middle::mir::mono::Linkage;
25+
use rustc_hir::attrs::Linkage;
2626
use rustc_middle::{
2727
mir::{interpret::GlobalAlloc, mono::MonoItem, Local, LocalDecl, Statement, Terminator},
2828
ty::{TyCtxt, TyKind},

0 commit comments

Comments
 (0)