Which LLVM instructions can exit a function?

Viewed 617

My goal is to determine all the possible exit points from an LLVM function. I know that terminator instructions end basic blocks, either to exit the function or to branch to another part of the same function. Among the terminator instructions, I am clear on most of them:

  • ret and resume exit the function
  • br, switch, indirectbr branch to other blocks in the same function
  • invoke, catchswitch related to exception control flow, and also should not exit the function
  • (unreachable can be ignored for this purpose)

I would like to seek clarification on catchret and cleanupret. I have compiled example exception handling code (clang++ on Mac and Ubuntu) and do not see these instructions in the compiled LLVM IR. Are these only used for specific ABIs?

0 Answers
Related