Open GoogleCodeExporter opened 9 years ago
I really like that idea. However, I worry that if the change isn't optional we
loose some debugging information. When something is wrong (bad parse, etc)
it's really nice to look at the raw graph.
So lets at it as an option that is by default enabled. Maybe just disable the
graph minimization when --debug is passed in.
Original comment by j.nick.terry@gmail.com
on 15 Sep 2010 at 3:04
So one of the things I'm noticing with this is that when we see control flow
graphs that show, for example, a separate blocks for lines 80, 81, 82, etc. (or
even line 81, line 81, line 81) the reason for this separate listing isn't
visually there until you throw trucov the --show-fake option.
Once --show-fake is used you see a fake arc coming out of the block in question
and, in every case I've seen, connecting with the end block. So I guess GCC
isn't grouping them because there are separate (exception?) arcs coming from
the different blocks.
You can easily see something like this with a statement such as:
std::cout << "Hello, world!" << std::endl << std::cout << "What's up?" <<
std::endl;
If you look at the control flow graph of the line above, you'd see several
blocks all with the same line number, and with --show-fake you'd see each block
has a fake arc going to the exit block.
So we could take into consideration a few things if we wanted to further
simplify the graphs:
- Ignore all fake arcs, look if block is normal (not a branch/end/start block),
look if destination is normal, and if so, "absorb" it.
- Don't ignore all fake arcs, but instead see if their destinations (and
number?) are the same between two blocks.
Or did anyone have in mind something else?
My guess is if you're going to use --show-fake, you wouldn't want the
control-flow graph simplified anyway, so I don't think we'd need to worry about
both simplifying and maintaining all of the fake arcs/blocks layout?
Original comment by william....@gmail.com
on 2 Dec 2010 at 3:46
Original issue reported on code.google.com by
william....@gmail.com
on 14 Sep 2010 at 5:18