This commit is contained in:
Antoni Boucher 2023-01-22 20:22:09 -05:00
parent f5ced68a66
commit fa6ae3c8bb
7 changed files with 21 additions and 14 deletions

View File

@ -172,7 +172,7 @@ debug_gimple_stmt(gimple_struct)
To get the `rustc` command to run in `gdb`, add the `--verbose` flag to `cargo build`.
To have the correct file paths in `gdb` instead of `/usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_personality.cc`, TODO
To have the correct file paths in `gdb` instead of `/usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_personality.cc`:
Maybe by calling the following at the beginning of gdb:
@ -180,7 +180,7 @@ Maybe by calling the following at the beginning of gdb:
set substitute-path /usr/src/debug/gcc /path/to/gcc-repo/gcc
```
TODO: but that's not what I remember I was doing.
TODO(antoyo): but that's not what I remember I was doing.
### How to use a custom-build rustc

View File

@ -13,7 +13,6 @@ src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs
src/test/ui/functions-closures/parallel-codegen-closures.rs
src/test/ui/linkage-attr/linkage1.rs
src/test/ui/lto/dylib-works.rs
src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
src/test/ui/numbers-arithmetic/saturating-float-casts.rs
src/test/ui/polymorphization/promoted-function.rs
src/test/ui/process/nofile-limit.rs
@ -47,6 +46,18 @@ src/test/ui/oom_unwind.rs
src/test/ui/panic-runtime/abort-link-to-unwinding-crates.rs
src/test/ui/panic-runtime/abort.rs
src/test/ui/panic-runtime/link-to-abort.rs
src/test/ui/unwind-no-uwtable.rs
src/test/ui/issues/issue-14875.rs
src/test/ui/issues/issue-29948.rs
src/test/ui/issues/issue-40883.rs
src/test/ui/issues/issue-43853.rs
src/test/ui/issues/issue-47364.rs
src/test/ui/simd/issue-17170.rs
src/test/ui/simd/issue-39720.rs
src/test/ui/simd/issue-85915-simd-ptrs.rs
src/test/ui/simd/issue-89193.rs
src/test/ui/statics/issue-91050-1.rs
src/test/ui/statics/issue-91050-2.rs
src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
src/test/ui/rfcs/rfc1857-drop-order.rs
src/test/ui/unwind-no-uwtable.rs

View File

@ -37,4 +37,3 @@ src/test/ui/cfg/cfg-panic.rs
src/test/ui/generator/size-moved-locals.rs
src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs
src/test/ui/runtime/rt-explody-panic-payloads.rs
src/test/ui/simd/issue-17170.rs

View File

@ -375,8 +375,7 @@ fn handle_fn_abi_err(
impl<'a, 'gcc, 'tcx> Deref for Builder<'a, 'gcc, 'tcx> {
type Target = CodegenCx<'gcc, 'tcx>;
fn deref<'b>(&'b self) -> &'a Self::Target
{
fn deref<'b>(&'b self) -> &'a Self::Target {
self.cx
}
}
@ -1216,7 +1215,7 @@ fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, pers_fn: RValue<'gcc>) -> RVa
let value = self.current_func().new_local(None, struct_type.as_type(), "landing_pad");
let ptr = self.cx.context.new_cast(None, ptr, field1_type);
self.block.add_assignment(None, value.access_field(None, field1), ptr);
self.block.add_assignment(None, value.access_field(None, field2), zero); // TODO: set the proper value here (the type of exception?).
self.block.add_assignment(None, value.access_field(None, field2), zero); // TODO(antoyo): set the proper value here (the type of exception?).
value.to_rvalue()
}
@ -1232,7 +1231,7 @@ fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>) -> RV
#[cfg(feature="master")]
fn resume(&mut self, exn: RValue<'gcc>) {
// TODO: check if this is normal that we need to dereference the value.
// TODO(antoyo): check if this is normal that we need to dereference the value.
// NOTE: the type is wrong, so in order to get a pointer for parameter, cast it to a
// pointer of pointer that is later dereferenced.
let exn_type = exn.get_type().make_pointer();

View File

@ -30,7 +30,7 @@ pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>)
let func =
if let Some(_func) = cx.get_declared_value(&sym) {
// FIXME: we never reach this because get_declared_value only returns global variables
// FIXME(antoyo): we never reach this because get_declared_value only returns global variables
// and here we try to get a function.
unreachable!();
/*

View File

@ -258,7 +258,6 @@ pub fn new(context: &'gcc Context<'gcc>, codegen_unit: &'tcx CodegenUnit<'tcx>,
pub fn rvalue_as_function(&self, value: RValue<'gcc>) -> Function<'gcc> {
let function: Function<'gcc> = unsafe { std::mem::transmute(value) };
// FIXME: seems like self.functions get overwritten for rust_eh_personality.
debug_assert!(self.functions.borrow().values().find(|value| **value == function).is_some(),
"{:?} is not a function", function);
function
@ -334,6 +333,7 @@ fn vtables(&self) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRe
fn get_fn(&self, instance: Instance<'tcx>) -> RValue<'gcc> {
let func = get_fn(self, instance);
*self.current_func.borrow_mut() = Some(func);
// FIXME(antoyo): this is a wrong cast. That requires changing the compiler API.
unsafe { std::mem::transmute(func) }
}

View File

@ -1158,8 +1158,6 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(bx: &'b mut Builder<'a, 'gcc, 'tcx>, try_fu
// the right personality function.
#[cfg(feature="master")]
fn codegen_gnu_try<'gcc>(bx: &mut Builder<'_, 'gcc, '_>, try_func: RValue<'gcc>, data: RValue<'gcc>, catch_func: RValue<'gcc>, dest: RValue<'gcc>) {
//use std::ops::Deref;
//let cx: &CodegenCx<'gcc, '_> = bx.deref();
let cx: &CodegenCx<'gcc, '_> = bx.cx;
let (llty, func) = get_rust_try_fn(cx, &mut |mut bx| {
// Codegens the shims described above:
@ -1204,7 +1202,7 @@ fn codegen_gnu_try<'gcc>(bx: &mut Builder<'_, 'gcc, '_>, try_func: RValue<'gcc>,
// NOTE: the blocks must be filled before adding the try/catch, otherwise gcc will not
// generate a try/catch.
// FIXME: add a check in the libgccjit API to prevent this.
// FIXME(antoyo): add a check in the libgccjit API to prevent this.
bx.switch_to_block(current_block);
bx.invoke(try_func_ty, try_func, &[data], then, catch, None);
});