gallivm: add new wrapper around Module::setOverrideStackAlignment()
We need it in the next commit to replace setting the stack alignment on i386 with LLVM >= 13 through the TargetOption::StackAlignmentOverride, which was removed in the upstream commit <https://github.com/llvm/llvm-project/commit/3787ee457173c3612aac4c9b1a2b6d6ab0202616>. Unfortunately Module::setOverrideStackAlignment() is not available through the C API and we need to wrap it ourselves. Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org> Reference: mesa/mesa#4906 Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11940>
This commit is contained in:
committed by
Marge Bot
parent
2a860bb8c3
commit
c1b4c64a28
@@ -615,3 +615,12 @@ lp_is_function(LLVMValueRef v)
|
||||
{
|
||||
return LLVMGetValueKind(v) == LLVMFunctionValueKind;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
lp_set_module_stack_alignment_override(LLVMModuleRef MRef, unsigned align)
|
||||
{
|
||||
#if LLVM_VERSION_MAJOR >= 13
|
||||
llvm::Module *M = llvm::unwrap(MRef);
|
||||
M->setOverrideStackAlignment(align);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -91,6 +91,9 @@ lp_is_function(LLVMValueRef v);
|
||||
|
||||
void
|
||||
lp_free_objcache(void *objcache);
|
||||
|
||||
void
|
||||
lp_set_module_stack_alignment_override(LLVMModuleRef M, unsigned align);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user