diff options
| author | Ralf Jung <post@ralfj.de> | 2025-08-01 06:54:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-01 06:54:32 +0000 |
| commit | d54e678d41ccde5398752118fa48d52a00402700 (patch) | |
| tree | ae04878eb5b0cbd933b4f28951cceac2b23d74c0 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 63cbeff540f0a855930dcc51d0275186100a224e (diff) | |
| parent | 0ff984894b263ba3efaee10a32ece57e50b2320a (diff) | |
| download | rust-d54e678d41ccde5398752118fa48d52a00402700.tar.gz rust-d54e678d41ccde5398752118fa48d52a00402700.zip | |
Merge pull request #4510 from rust-lang/rustup-2025-08-01
Automatic Rustup
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; + } +} |
