aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-22 14:39:51 +0100
committergingerBill <bill@gingerbill.org>2023-09-22 14:39:51 +0100
commit082324d7b97e521f5d8dada40629da4e689197c9 (patch)
tree6a7e993cd7a7d9428732db3568ae755b73d428c9 /src/llvm_backend_const.cpp
parent5e99289d7afd34cf785b15f727ed2f2d61aa6ffc (diff)
Begin work on making the type info table be constantly initialized
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index f3c3871ff..a16b2293c 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -284,14 +284,12 @@ gb_internal lbValue lb_expr_untyped_const_to_typed(lbModule *m, Ast *expr, Type
return lb_const_value(m, t, tv.value);
}
-gb_internal lbValue lb_emit_source_code_location_const(lbProcedure *p, String const &procedure, TokenPos const &pos) {
- lbModule *m = p->module;
-
+gb_internal lbValue lb_const_source_code_location_const(lbModule *m, String const &procedure, TokenPos const &pos) {
LLVMValueRef fields[4] = {};
- fields[0]/*file*/ = lb_find_or_add_entity_string(p->module, get_file_path_string(pos.file_id)).value;
+ fields[0]/*file*/ = lb_find_or_add_entity_string(m, get_file_path_string(pos.file_id)).value;
fields[1]/*line*/ = lb_const_int(m, t_i32, pos.line).value;
fields[2]/*column*/ = lb_const_int(m, t_i32, pos.column).value;
- fields[3]/*procedure*/ = lb_find_or_add_entity_string(p->module, procedure).value;
+ fields[3]/*procedure*/ = lb_find_or_add_entity_string(m, procedure).value;
lbValue res = {};
res.value = llvm_const_named_struct(m, t_source_code_location, fields, gb_count_of(fields));
@@ -299,6 +297,12 @@ gb_internal lbValue lb_emit_source_code_location_const(lbProcedure *p, String co
return res;
}
+
+gb_internal lbValue lb_emit_source_code_location_const(lbProcedure *p, String const &procedure, TokenPos const &pos) {
+ lbModule *m = p->module;
+ return lb_const_source_code_location_const(m, procedure, pos);
+}
+
gb_internal lbValue lb_emit_source_code_location_const(lbProcedure *p, Ast *node) {
String proc_name = {};
if (p->entity) {