@@ -640,12 +640,19 @@ class MCPlusBuilder {
640640 // / it may be important for the compiler to check the address explicitly not
641641 // / to introduce a signing or authentication oracle.
642642 // /
643- // / If this function returns a (Reg, Inst) pair and before execution of Inst
643+ // / This function is intended to detect a complex, multi-instruction pointer-
644+ // / checking sequence spanning a contiguous range of instructions at the end
645+ // / of the basic block (as these sequences are expected to end with a
646+ // / conditional branch - this is how they are implemented on AArch64 by LLVM).
647+ // / If a (Reg, FirstInst) pair is returned and before execution of FirstInst
644648 // / Reg was last written to by an authentication instruction, then it is known
645649 // / that in any successor of BB either
646650 // / * the authentication instruction that last wrote to Reg succeeded, or
647651 // / * the program is terminated abnormally without introducing any signing
648652 // / or authentication oracles
653+ // /
654+ // / Note that this function is not expected to repeat the results returned
655+ // / by getAuthCheckedReg(Inst, MayOverwrite) function below.
649656 virtual std::optional<std::pair<MCPhysReg, MCInst *>>
650657 getAuthCheckedReg (BinaryBasicBlock &BB) const {
651658 llvm_unreachable (" not implemented" );
@@ -660,6 +667,9 @@ class MCPlusBuilder {
660667 // /
661668 // / Additionally, if MayOverwrite is false, it is known that the authenticated
662669 // / pointer is not clobbered by Inst itself.
670+ // /
671+ // / Use this function for simple, single-instruction patterns instead of
672+ // / its getAuthCheckedReg(BB) counterpart.
663673 virtual MCPhysReg getAuthCheckedReg (const MCInst &Inst,
664674 bool MayOverwrite) const {
665675 llvm_unreachable (" not implemented" );
0 commit comments