From 3695af697efa26b0ea3b67739ade3ecc3929154e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 19 Feb 2024 15:02:49 +0100 Subject: Set writable and dead_on_unwind attributes for sret arguments --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 37c2da4c23a..fb5a56155fd 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -312,6 +312,16 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) { return Attribute::SafeStack; case FnRetThunkExtern: return Attribute::FnRetThunkExtern; +#if LLVM_VERSION_GE(18, 0) + case Writable: + return Attribute::Writable; + case DeadOnUnwind: + return Attribute::DeadOnUnwind; +#else + case Writable: + case DeadOnUnwind: + report_fatal_error("Not supported on this LLVM version"); +#endif } report_fatal_error("bad AttributeKind"); } -- cgit 1.4.1-3-g733a5