some debugging niceties

This commit is contained in:
Folkert 2022-03-13 00:12:16 +01:00
parent 39792ccb93
commit d7a5cd7b11
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 19 additions and 1 deletions

View file

@ -75,7 +75,7 @@ pub fn call_str_bitcode_fn<'a, 'ctx, 'env>(
.unwrap();
let str_type = super::convert::zig_str_type(env);
let result = create_entry_block_alloca(env, parent, str_type.into(), "str_alloca");
let result = create_entry_block_alloca(env, parent, str_type.into(), "return_str_alloca");
let mut arguments: Vec<BasicValueEnum> = Vec::with_capacity_in(args.len() + 1, env.arena);
arguments.push(result.into());

View file

@ -4317,6 +4317,24 @@ fn build_proc_header<'a, 'ctx, 'env>(
);
}
if false {
use inkwell::attributes::{Attribute, AttributeLoc};
let kind_id = Attribute::get_named_enum_kind_id("alwaysinline");
debug_assert!(kind_id > 0);
let enum_attr = env.context.create_enum_attribute(kind_id, 1);
fn_val.add_attribute(AttributeLoc::Function, enum_attr);
}
if false {
use inkwell::attributes::{Attribute, AttributeLoc};
let kind_id = Attribute::get_named_enum_kind_id("noinline");
debug_assert!(kind_id > 0);
let enum_attr = env.context.create_enum_attribute(kind_id, 1);
fn_val.add_attribute(AttributeLoc::Function, enum_attr);
}
fn_val
}