aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2025-10-14 19:55:00 +0200
committerLaytan <laytanlaats@hotmail.com>2025-10-14 19:55:00 +0200
commite7ecb16a1e0fa98e2ad413100de9cf4ffe9820e8 (patch)
tree3ae9220c7c796622195798613558e22aef571e83 /src/llvm_abi.cpp
parent78e9a22ffaeb3191806eee59a807e38d9b942ee0 (diff)
llvm 21 support
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++) {