[cfe-dev] Default case without predecessor

Panke tobias at pankrath.net
Wed Jan 29 10:33:07 PST 2014


Hi, 

If I run clang on the code below, either via my own FrontendAction and
libtooling or just with
clang -cc1 -analyze -analyze-checker debug.DumpCFG I get an CFG where the
default case
has no predecessor. If I compile the code to llvm and dump a CFG from opt
then all cases
are successors of the switch.

Is it possible to obtain a CFG from clang with all edges for the switch
statement?

cheers,
Panke

--
typedef enum E
{
	A,
	B
} E;

int foo(E e)
{
	switch(e)
	{
		case A:
			return 12;
		case B:
			return 42;
		default:
			return 1242;
	}
	return 0;
}
--





--
View this message in context: http://clang-developers.42468.n3.nabble.com/Default-case-without-predecessor-tp4037484.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list