<div dir="ltr"><div>I believe the edge from the switch to the default case is pruned because all of the enum values are covered by the switch.  The analyzer is considering the default case as "not possible".<br><br>

</div>Zach<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 12:33 PM, Panke <span dir="ltr"><<a href="mailto:tobias@pankrath.net" target="_blank">tobias@pankrath.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If I run clang on the code below, either via my own FrontendAction and<br>
libtooling or just with<br>
clang -cc1 -analyze -analyze-checker debug.DumpCFG I get an CFG where the<br>
default case<br>
has no predecessor. If I compile the code to llvm and dump a CFG from opt<br>
then all cases<br>
are successors of the switch.<br>
<br>
Is it possible to obtain a CFG from clang with all edges for the switch<br>
statement?<br>
<br>
cheers,<br>
Panke<br>
<br>
--<br>
typedef enum E<br>
{<br>
        A,<br>
        B<br>
} E;<br>
<br>
int foo(E e)<br>
{<br>
        switch(e)<br>
        {<br>
                case A:<br>
                        return 12;<br>
                case B:<br>
                        return 42;<br>
                default:<br>
                        return 1242;<br>
        }<br>
        return 0;<br>
}<br>
--<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Default-case-without-predecessor-tp4037484.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Default-case-without-predecessor-tp4037484.html</a><br>


Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>