aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-11-01 15:52:40 +0000
committerGitHub <noreply@github.com>2022-11-01 15:52:40 +0000
commit382bd87667a275f9b276886f7c1e8caac4dda5f6 (patch)
treebcfb541078f7e1d45fc3e1be7da5bb9cae864502 /src/llvm_backend_const.cpp
parent6cc07dc24e4eb9800b1086580d271970b45f77cb (diff)
parentc39ef1b25cc77f0179156430e45ef1d3c2028b7b (diff)
Merge pull request #2169 from odin-lang/location-byvaldev-2022-11
Ad-hoc pass source code location directly by pointer without stack copy
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index a2209a89f..a8b66a0ea 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -256,7 +256,7 @@ lbValue lb_expr_untyped_const_to_typed(lbModule *m, Ast *expr, Type *t) {
return lb_const_value(m, t, tv.value);
}
-lbValue lb_emit_source_code_location(lbProcedure *p, String const &procedure, TokenPos const &pos) {
+lbValue lb_emit_source_code_location_const(lbProcedure *p, String const &procedure, TokenPos const &pos) {
lbModule *m = p->module;
LLVMValueRef fields[4] = {};
@@ -271,7 +271,7 @@ lbValue lb_emit_source_code_location(lbProcedure *p, String const &procedure, To
return res;
}
-lbValue lb_emit_source_code_location(lbProcedure *p, Ast *node) {
+lbValue lb_emit_source_code_location_const(lbProcedure *p, Ast *node) {
String proc_name = {};
if (p->entity) {
proc_name = p->entity->token.string;
@@ -280,11 +280,11 @@ lbValue lb_emit_source_code_location(lbProcedure *p, Ast *node) {
if (node) {
pos = ast_token(node).pos;
}
- return lb_emit_source_code_location(p, proc_name, pos);
+ return lb_emit_source_code_location_const(p, proc_name, pos);
}
lbValue lb_emit_source_code_location_as_global(lbProcedure *p, String const &procedure, TokenPos const &pos) {
- lbValue loc = lb_emit_source_code_location(p, procedure, pos);
+ lbValue loc = lb_emit_source_code_location_const(p, procedure, pos);
lbAddr addr = lb_add_global_generated(p->module, loc.type, loc, nullptr);
lb_make_global_private_const(addr);
return lb_addr_load(p, addr);
@@ -292,7 +292,7 @@ lbValue lb_emit_source_code_location_as_global(lbProcedure *p, String const &pro
lbValue lb_emit_source_code_location_as_global(lbProcedure *p, Ast *node) {
- lbValue loc = lb_emit_source_code_location(p, node);
+ lbValue loc = lb_emit_source_code_location_const(p, node);
lbAddr addr = lb_add_global_generated(p->module, loc.type, loc, nullptr);
lb_make_global_private_const(addr);
return lb_addr_load(p, addr);