mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
use inline always strategically
This commit is contained in:
parent
afe2f51660
commit
cba729a933
5 changed files with 126 additions and 24 deletions
|
@ -81,12 +81,22 @@ pub fn gen_from_mono_module(
|
|||
// module.strip_debug_info();
|
||||
|
||||
// mark our zig-defined builtins as internal
|
||||
use inkwell::attributes::{Attribute, AttributeLoc};
|
||||
use inkwell::module::Linkage;
|
||||
|
||||
let kind_id = Attribute::get_named_enum_kind_id("alwaysinline");
|
||||
debug_assert!(kind_id > 0);
|
||||
let attr = context.create_enum_attribute(kind_id, 1);
|
||||
|
||||
for function in FunctionIterator::from_module(module) {
|
||||
let name = function.get_name().to_str().unwrap();
|
||||
if name.starts_with("roc_builtins") {
|
||||
function.set_linkage(Linkage::Internal);
|
||||
}
|
||||
|
||||
if name.starts_with("roc_builtins.dict") {
|
||||
function.add_attribute(AttributeLoc::Function, attr);
|
||||
}
|
||||
}
|
||||
|
||||
let builder = context.create_builder();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue