LLVM程序分析日记之unique predecessor/successor

查看LLVM BasicBlock类的文档时,发现了一些有意思的成员函数

BasicBlock *getSingleSuccessor () const
 	Return the successor of this block if it has a single successor. More...

BasicBlock *getUniqueSuccessor () const
 	Return the successor of this block if it has a unique successor. More...

我们主要疑惑于其中"Unique"的含义。在查阅源码注释后,基本得到了解答:

/// Note that unique predecessor doesn't mean single edge, there can be
/// multiple edges from the unique predecessor to this block (for example a
/// switch statement with multiple cases having the same destination).
posted @ 2021-01-30 11:22  bjchan9an  阅读(385)  评论(0)    收藏  举报