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

Marcin Świderski marcin.sfider at gmail.com
Mon Aug 16 16:41:10 PDT 2010


Hi,

I've done some work on CFG. Biggest change is that CFGElement can no longer
be converted to Stmt* (through static_cast nor dyn_cast). This is needed to
properly handle all kinds of CFGElement: Statement, Initializer,
ImplicitDtor and Scope. I've fixed some of the code that was assuming the
CFGElement to represent Stmt* and left rest of it with appropriate comments.

I've also added Initializer CFGElements creation in CFG. Initializer
CFGElement returns CXXBaseOrMemberInitializer object instead of Stmt.

For ImplicitDtor CFGElements I'm planning to add methods for getting:
- CXXDestructorDecl for destructor to call,
- Location of place destructor was called,
- Exact statement that created the object for which destructor is called
(Expr for temporary object and VarDecl for automatic object).

I think that it would also be useful to add methods for transparently
getting:
- Start location of the CFGElement,
- End location of the CFGElement.

Now a few questions:
- Do you have any suggestions on what more should be added to CFGElement
interface?
- In valid AST, can the CXXBaseOrMemberInitializer::getInit() method return
null pointer?

Cheers,
Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100817/a53b1d48/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initializers.patch
Type: application/octet-stream
Size: 27898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100817/a53b1d48/attachment.obj>


More information about the cfe-dev mailing list