Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler-rt] [builtins] Remove unused/misnamed x86 chkstk functions
For both MSVC and MinGW targets, the compiler generates calls to functions for probing the stack, in functions that allocate a larger amount of stack space. The exact behaviour of these functions differ per architecture (some decrement the stack, some actually decrement the stack pointer, some only probe the stack). In MSVC mode, the compiler always generates calls to a symbol named "__chkstk". In MinGW mode, the symbol is named "__alloca" on i386 and "___chkstk_ms" on x86_64, but the functions behave exactly the same as their MSVC counterparts despite the differing names. (On i386, these names are the raw symbol names - if considering a C level function name with the extra implicit leading underscore, they would be called "_chkstk" and "_alloca".) Remove the misleading duplicate and unused functions. These were added in fbfed86 / c27de5b (adding "___chkstk_ms" for both architectures, even if that symbol name only was used on x86_64) and 40eb83b (adding "__alloca" and "___chkstk", even if the former only was used on i386, and the latter seeming like a misspelled form of the MSVC function, with three underscores instead of two). The x86_64 "___chkstk" was doubly surprising as that function had the same behaviour as the function used on i386, while the "__chkstk" that MSVC emitted calls to should behave exactly like the preexisting "___chkstk_ms". Remove the unused functions, and rename the misspelled MSVC-like symbols to the correct name that MSVC mode actually uses. Note that these files aren't assembled at all when building compiler-rt builtins in MSVC mode, as they are expected to be provided by MSVC libraries when building code in MSVC mode. Differential Revision: https://reviews.llvm.org/D159139
- Loading branch information