[cfe-users] detect default in SwitchInst

Bella V via cfe-users cfe-users at lists.llvm.org
Fri Jul 16 12:33:46 PDT 2021


Hello All,



I'm trying to find whether SwitchInst has a default statement. I'm able to
iterate through the case values using case_begin and case_end. If I try to
detect default using case_default which returns an iterator which points to
the default case.

Code Example:

case_default()->getCaseIndex() or case_default()->getSuccessorIndex()
returns the same values for both default and non-default switch C code.


Any suggestions to solve this problem?


Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20210716/70d8780e/attachment.html>


More information about the cfe-users mailing list