aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_proc.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 12:44:13 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 12:44:13 +0100
commit3533094cc2fc8cae8229b9887efae4541ccd278b (patch)
tree90e61fb942229fee838692013deb8f9720bc7a78 /src/llvm_backend_proc.cpp
parent5ce6676914f5daadf42613574d4700c2750275de (diff)
Restrict `#no_capture` to pointer-like types only
Diffstat (limited to 'src/llvm_backend_proc.cpp')
-rw-r--r--src/llvm_backend_proc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/llvm_backend_proc.cpp b/src/llvm_backend_proc.cpp
index 825434c31..272ffb474 100644
--- a/src/llvm_backend_proc.cpp
+++ b/src/llvm_backend_proc.cpp
@@ -254,7 +254,9 @@ gb_internal lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool i
lb_add_proc_attribute_at_index(p, offset+parameter_index, "noalias");
}
if (e->flags&EntityFlag_NoCapture) {
- lb_add_proc_attribute_at_index(p, offset+parameter_index, "nocapture");
+ if (is_type_internally_pointer_like(e->type)) {
+ lb_add_proc_attribute_at_index(p, offset+parameter_index, "nocapture");
+ }
}
parameter_index += 1;
}