diff options
author | Kees Cook <keescook@chromium.org> | 2024-04-29 14:54:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 14:54:10 -0700 |
commit | 869ffcf3f6ca74c8a0ec6eb250d45e6ea0680c81 (patch) | |
tree | ded837e60793c15a0c83ceebde18d05b6901dd0d /llvm/lib/Transforms/Utils/BuildLibCalls.cpp | |
parent | 3a0d894fafddace75f03fa7df25022cadbe2dffc (diff) | |
download | llvm-869ffcf3f6ca74c8a0ec6eb250d45e6ea0680c81.zip llvm-869ffcf3f6ca74c8a0ec6eb250d45e6ea0680c81.tar.gz llvm-869ffcf3f6ca74c8a0ec6eb250d45e6ea0680c81.tar.bz2 |
[CodeGen][i386] Move -mregparm storage earlier and fix Runtime calls (#89707)
When building the Linux kernel for i386, the -mregparm=3 option is
enabled. Crashes were observed in the sanitizer handler functions, and
the problem was found to be mismatched calling convention.
As was fixed in commit c167c0a4dcdb ("[BuildLibCalls] infer inreg param
attrs from NumRegisterParameters"), call arguments need to be marked as
"in register" when -mregparm is set. Use the same helper developed there
to update the function arguments.
Since CreateRuntimeFunction() is actually part of CodeGenModule, storage
of the -mregparm value is also moved to the constructor, as doing this
in Release() is too late.
Fixes: https://github.com/llvm/llvm-project/issues/89670
Diffstat (limited to 'llvm/lib/Transforms/Utils/BuildLibCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp index ed0ed34..e97506b 100644 --- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp @@ -1255,7 +1255,7 @@ static void setRetExtAttr(Function &F, } // Modeled after X86TargetLowering::markLibCallAttributes. -static void markRegisterParameterAttributes(Function *F) { +void llvm::markRegisterParameterAttributes(Function *F) { if (!F->arg_size() || F->isVarArg()) return; |