In preparation for supporting BLRA* instructions in SLS Hardening on AArch64, refactor ThunkInserter class. The main intention of this commit is to document the way to merge the BLR-rewriting logic of the AArch64SLSHardening pass into the SLSBLRThunkInserter class. This makes it possible to only call createThunkFunction for the thunks that are actually referenced. Ultimately, it will prevent SLSBLRThunkInserter from unconditionally generating about 1800 thunk functions corresponding to every possible combination of operands passed to BLRAA or BLRAB instructions. This particular commit does not affect the generated machine code and consists of the following changes: * document the existing behavior of ThunkInserter class * introduce ThunkInserterPass template class to get rid of mostly identical boilerplate code in ARM, AArch64 and X86 implementations * move the InsertedThunks parameter from `mayUseThunk` to `insertThunks` method
15 KiB
15 KiB