[cfe-dev] Adding a CFG node for the allocation call in a new-expression

Jordan Rose jediknil at belkadan.com
Wed Apr 4 12:05:15 PDT 2012


Updated patch that doesn't crash horribly on trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CFGAllocation.patch
Type: application/octet-stream
Size: 26233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120404/61366ec3/attachment.obj>
-------------- next part --------------



On Apr 4, 2012, at 13:06, Jordan Rose wrote:

> Hi, Ted (and list). After the negative feedback on representing new-expression allocations using CXXOperatorCallExpr, I went back to the original idea of adding a CFG node. Without properly modelling constructors this doesn't gain us very much right now, but it does set the stage for eventually being able to get all of the behavior of a new-expression into the analyzer.
> 
> Missing pieces:
> 
> - What does it mean to be PreStmt<CXXNewExpr> if the allocation and the initializer have already happened? (Note that right neither PreStmt nor PostStmt checks are done on CXXNewExpr, but that's easily fixed.)
> 
> - How can we represent "calls" that don't have associated expressions? I'm starting to think CallOrObjCMessage needs to turn into a real "abstract call" model which may or may not have expressions for the arguments and can handle regular calls, messages, constructors, destructors, allocations, and deletions.  New checks: preCall and postCall. But that's a bit outside the scope of this patch.
> 
> Anyway, how does this part look?
> Jordy
> 
> <CFGAllocation.patch>



More information about the cfe-dev mailing list