aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorUsername-Leon <leonardo.temperanza@gmail.com>2025-10-15 15:30:32 +0200
committerUsername-Leon <leonardo.temperanza@gmail.com>2025-10-15 15:30:32 +0200
commit4dd6bb2e871e9b8583a89e62ce36a98d02d48cc3 (patch)
tree25b7599645caf76ebe9136da51e5114006ab93f4 /src/llvm_abi.cpp
parente10093bd991334789031df9ed587d27823ca90dd (diff)
parent596066aa0453752f24cc2fa5087fafe2c4686536 (diff)
Merge branch 'master' of https://github.com/LeonardoTemperanza/Odin
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 9f2faaa08..ec7c63b1a 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -144,7 +144,11 @@ gb_internal void lb_add_function_type_attributes(LLVMValueRef fn, lbFunctionType
LLVMContextRef c = ft->ctx;
LLVMAttributeRef noalias_attr = lb_create_enum_attribute(c, "noalias");
LLVMAttributeRef nonnull_attr = lb_create_enum_attribute(c, "nonnull");
+#if LLVM_VERSION_MAJOR >= 21
+ LLVMAttributeRef nocapture_attr = lb_create_string_attribute(c, make_string_c("captures"), make_string_c("none"));
+#else
LLVMAttributeRef nocapture_attr = lb_create_enum_attribute(c, "nocapture");
+#endif
unsigned arg_index = offset;
for (unsigned i = 0; i < arg_count; i++) {