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:
retandresumeexit the functionbr,switch,indirectbrbranch to other blocks in the same functioninvoke,catchswitchrelated to exception control flow, and also should not exit the function- (
unreachablecan 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?