Skip to content

Commit

Permalink
extract global creation into function
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiedt committed Aug 10, 2023
1 parent daee6f4 commit 8fb87a1
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 105 deletions.
1 change: 1 addition & 0 deletions compiler/backend_inkwell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ edition = "2021"
[dependencies]
candy_frontend = { version = "0.1.0", path = "../frontend" }
inkwell = { version = "0.2.0", features = ["llvm15-0"] }
itertools = "0.11.0"
llvm-sys = { version = "150", features = ["prefer-dynamic"] }
2 changes: 1 addition & 1 deletion compiler/backend_inkwell/candy_rt/candy_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ const candy_value_t *candy_builtin_type_of(candy_value_t *value)
default:
candy_panic(&__internal_unknown);
}
}
}
2 changes: 1 addition & 1 deletion compiler/backend_inkwell/candy_rt/candy_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const candy_value_t *candy_builtin_print(candy_value_t *value);
candy_value_t *candy_builtin_struct_get(candy_value_t *structure, candy_value_t *key);
candy_value_t *candy_builtin_struct_get_keys(candy_value_t *structure);
const candy_value_t *candy_builtin_struct_has_key(candy_value_t *structure, candy_value_t *key);
const candy_value_t *candy_builtin_type_of(candy_value_t *value);
const candy_value_t *candy_builtin_type_of(candy_value_t *value);
2 changes: 1 addition & 1 deletion compiler/backend_inkwell/candy_rt/candy_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ void free_candy_value(candy_value_t *value)
// the list/struct, because they will be freed on their own
// at the end of the main function.
free(value);
}
}
2 changes: 1 addition & 1 deletion compiler/backend_inkwell/candy_rt/candy_rt.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ candy_function get_candy_function_pointer(candy_value_t *function);
void *get_candy_function_environment(candy_value_t *function);
void candy_panic(const candy_value_t *reason);
void free_candy_value(candy_value_t *value);
#endif
#endif
Loading

1 comment on commit 8fb87a1

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on 8fb87a1 Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: 8fb87a1 Previous: d020a7f Ratio
Time: Compiler/hello_world 21941375 ns/iter (± 488348) 22065801 ns/iter (± 467242) 0.99
Time: Compiler/fibonacci 166431505 ns/iter (± 1492034) 183317952 ns/iter (± 1599966) 0.91
Time: VM Runtime/hello_world 21100 ns/iter (± 2393) 17800 ns/iter (± 4091) 1.19
Time: VM Runtime/fibonacci/15 266034179 ns/iter (± 1180598) 309274921 ns/iter (± 2303812) 0.86
Time: VM Runtime/PLB/binarytrees/6 1233321886 ns/iter (± 4605488) 1439774329 ns/iter (± 6155464) 0.86

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.