Implement support for explicit tail calls in the MIR block builders and the LLVM codegen backend.
This commit is contained in:
@@ -97,6 +97,16 @@ pub(crate) enum ModuleFlagMergeBehavior {
|
||||
|
||||
// Consts for the LLVM CallConv type, pre-cast to usize.
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[repr(C)]
|
||||
#[allow(dead_code)]
|
||||
pub(crate) enum TailCallKind {
|
||||
None = 0,
|
||||
Tail = 1,
|
||||
MustTail = 2,
|
||||
NoTail = 3,
|
||||
}
|
||||
|
||||
/// LLVM CallingConv::ID. Should we wrap this?
|
||||
///
|
||||
/// See <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/CallingConv.h>
|
||||
@@ -1186,6 +1196,7 @@ unsafe extern "C" {
|
||||
pub(crate) safe fn LLVMIsGlobalConstant(GlobalVar: &Value) -> Bool;
|
||||
pub(crate) safe fn LLVMSetGlobalConstant(GlobalVar: &Value, IsConstant: Bool);
|
||||
pub(crate) safe fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
|
||||
pub(crate) safe fn LLVMRustSetTailCallKind(CallInst: &Value, Kind: TailCallKind);
|
||||
|
||||
// Operations on attributes
|
||||
pub(crate) fn LLVMCreateStringAttribute(
|
||||
|
||||
Reference in New Issue
Block a user