diff options
| author | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-08-04 04:25:09 +0000 |
|---|---|---|
| committer | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-08-04 04:25:09 +0000 |
| commit | 682a6e17e4dcc02944b00834f11e7cdd7067ebd1 (patch) | |
| tree | ad7f71f36fed97f65204d8a1f8c594c8ac1d2df8 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | b8d1af5e5633ff1ac1c9c9a3921af2d8e8620410 (diff) | |
| parent | 383b9c447b61641e1f1a3850253944a897a60827 (diff) | |
| download | rust-682a6e17e4dcc02944b00834f11e7cdd7067ebd1.tar.gz rust-682a6e17e4dcc02944b00834f11e7cdd7067ebd1.zip | |
Merge ref '383b9c447b61' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 383b9c447b61641e1f1a3850253944a897a60827 Filtered ref: 14b7b0bbd1e38402fca29ef84e5f75ee9d8cb1a9 This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index c9814beedd6..588d867bbbf 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1986,3 +1986,29 @@ extern "C" void LLVMRustSetNoSanitizeHWAddress(LLVMValueRef Global) { MD.NoHWAddress = true; GV.setSanitizerMetadata(MD); } + +enum class LLVMRustTailCallKind { + None = 0, + Tail = 1, + MustTail = 2, + NoTail = 3 +}; + +extern "C" void LLVMRustSetTailCallKind(LLVMValueRef Call, + LLVMRustTailCallKind Kind) { + CallInst *CI = unwrap<CallInst>(Call); + switch (Kind) { + case LLVMRustTailCallKind::None: + CI->setTailCallKind(CallInst::TCK_None); + break; + case LLVMRustTailCallKind::Tail: + CI->setTailCallKind(CallInst::TCK_Tail); + break; + case LLVMRustTailCallKind::MustTail: + CI->setTailCallKind(CallInst::TCK_MustTail); + break; + case LLVMRustTailCallKind::NoTail: + CI->setTailCallKind(CallInst::TCK_NoTail); + break; + } +} |
