REVERT ME - add some debug info

This commit is contained in:
Richard Feldman 2022-11-16 17:07:04 -05:00
parent 58e672749c
commit 36178b5f59
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B
4 changed files with 17 additions and 3 deletions

View File

@ -4147,6 +4147,9 @@ pub fn build_procedures<'a, 'ctx, 'env>(
let captures_niche = CapturesNiche::no_niche();
for (symbol, top_level) in glue_layouts.getters.iter().copied() {
dbg!(symbol, unsafe {
std::mem::transmute::<Symbol, u64>(symbol)
});
let it = top_level.arguments.iter().copied();
let bytes =
roc_alias_analysis::func_name_bytes_help(symbol, it, captures_niche, &top_level.result);
@ -4180,7 +4183,7 @@ pub fn build_procedures<'a, 'ctx, 'env>(
getter_fn,
top_level.arguments,
top_level.result,
getter_name,
dbg!(getter_name),
);
}
}

View File

@ -190,7 +190,7 @@ pub fn load_types(
// the structs and fields.
//
// Store them as strings, because symbols won't be useful to glue generators!
names.push(name.as_str(&interns).to_string());
names.push(dbg!(name.as_str(&interns)).to_string());
}
glue_procs_by_layout.insert(layout, names.into_bump_slice());

View File

@ -16,3 +16,8 @@
#![allow(clippy::redundant_static_lifetimes)]
#![allow(clippy::needless_borrow)]
#![allow(clippy::clone_on_copy)]
type Op_StderrWrite = roc_std::RocStr;
type Op_StdoutWrite = roc_std::RocStr;
type TODO_roc_function_69 = roc_std::RocStr;
type TODO_roc_function_70 = roc_std::RocStr;

View File

@ -97,6 +97,8 @@ pub unsafe extern "C" fn roc_send_signal(pid: libc::pid_t, sig: libc::c_int) ->
pub extern "C" fn rust_main() -> i32 {
use glue::discriminant_Op::*;
println!("Let's do things!");
let op: Op = unsafe {
let mut mem = MaybeUninit::uninit();
@ -105,11 +107,13 @@ pub extern "C" fn rust_main() -> i32 {
mem.assume_init()
};
match op.discriminant() {
match dbg!(op.discriminant()) {
StdoutWrite => {
let output: RocStr = unsafe { op.get_StdoutWrite_0() };
// let _next = unsafe { op.get_StdoutWrite_1() };
dbg!(&output);
if let Err(e) = std::io::stdout().write_all(output.as_bytes()) {
panic!("Writing to stdout failed! {:?}", e);
}
@ -125,6 +129,8 @@ pub extern "C" fn rust_main() -> i32 {
Done => {}
}
println!("Done!");
// Exit code
0
}