[llvm-dev] In LLVM IR, how can I determine if a switch statement had an explicit default case?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 15 07:35:59 PST 2016

Hi Don,

On 14 November 2016 at 19:00, don hinton via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Since a SwitchInst always has a default case even if no default case
> appeared in the code, what's the best way to determine if it's explicit or
> implicit?

You'd have to examine Clang's AST for that information, it's not
present once the LLVM IR has been emitted.

What are you actually trying to do that makes you think you need that
information? There might be an alternative approach.



More information about the llvm-dev mailing list