diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-15 11:25:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-15 11:25:54 +0100 |
| commit | 596066aa0453752f24cc2fa5087fafe2c4686536 (patch) | |
| tree | d74030d55bd21b7631a212a29e9ae949f6de22dd /src/llvm_abi.cpp | |
| parent | 186589266b8a53d089ce4782214c59ed9c8f64cc (diff) | |
| parent | e7ecb16a1e0fa98e2ad413100de9cf4ffe9820e8 (diff) | |
Merge pull request #5808 from laytan/llvm-21
llvm 21 support
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 4 |
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++) { |