[cfe-dev] CFGElement changes and initializers addition (with patch)

Jordy Rose jediknil at belkadan.com
Tue Aug 17 22:47:21 PDT 2010


Wow, good work.

I agree with most of what Ted said. A few additional comments:

- I like the single enum rather than kind and subkind, but there are 7
elements, not 6. So it won't fit in a PointerIntPair anyway, though having
a Stmt* field (or void*) and an enum field would be preferable to two
PointerIntPairs.
I'm still not totally convinced we need scope markers in the CFG, though.

- Why don't we make this a static type hierarchy like SVal or MemRegion?
We'd have CFGStmt, CFGInitializer, CFGDestructor, and CFGScope(Marker)
inheriting from CFGElement. That way we can have, among other things, a
CFGStmt that simplifies to a Stmt. Instead of asserts, we can just have the
type-specific methods on the subclasses.

- In UnreachableCodeChecker::getUnreachableStmt(), isn't the block
guaranteed to have an initial statement for the same reason as in
ReachableCode.cpp?

- Very tiny comment: most of the LLVM codebase has no indentation on blank
lines.

Great to get more C++ support in the analyzer!
Jordy



More information about the cfe-dev mailing list