We should preserve built-in functions when running InternalizePass.
Similar to
|
AlwaysPreserved.insert("__stack_chk_fail"); |
|
if (Triple(M.getTargetTriple()).isOSAIX()) |
|
AlwaysPreserved.insert("__ssp_canary_word"); |
|
else |
|
AlwaysPreserved.insert("__stack_chk_guard"); |
and
|
static const char *PreservedSymbols[] = { |
|
#define HANDLE_LIBCALL(code, name) name, |
|
#include "llvm/IR/RuntimeLibcalls.def" |
|
#undef HANDLE_LIBCALL |
|
// There are global variables, so put it here instead of in |
|
// RuntimeLibcalls.def. |
|
// TODO: Are there similar such variables? |
|
"__ssp_canary_word", |
|
"__stack_chk_guard", |
|
}; |
.
Related issue: rust-lang/rust#113923.
We should preserve built-in functions when running
InternalizePass.Similar to
llvm-project/llvm/lib/Transforms/IPO/Internalize.cpp
Lines 230 to 234 in 39d8e6e
llvm-project/llvm/lib/Object/IRSymtab.cpp
Lines 48 to 57 in 7021182
Related issue: rust-lang/rust#113923.