[cfe-commits] r161552 - in /cfe/trunk: include/clang/Frontend/Analyses.def include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib/StaticAnalyzer/Core/CallEvent.cpp lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp test/Analysis/inlining/DynDispatchBifurcate.m

Jordan Rose jordan_rose at apple.com
Thu Aug 9 09:31:21 PDT 2012


It took me a while to figure out what RuntimeDefinition is doing, especially since the other objects just ignore the region argument. It looks like it's actually being used the same way as my old "IsDynamicDispatch" flag, but using a MemRegion to key any dynamic dispatch assumptions. Can we rename the region to something like "DispatchRegion"? Also, comments would help immensely. (The comment for getRuntimeDefinition() is now stale.)

I'm feeling a little funny about having the inlining decision so decoupled from DynamicTypeInfo, but then again Ted did point out (offline) that "we can inline -[Foo bar]" just means that the receiver's class doesn't override -bar, not that the receiver is actually a Foo instance. I might come back to this if I can put a finger on what's bothering me.


On Aug 8, 2012, at 5:21 PM, Anna Zaks <ganna at apple.com> wrote:

> Author: zaks
> Date: Wed Aug  8 19:21:33 2012
> New Revision: 161552
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=161552&view=rev
> Log:
> [analyzer] Bifurcate the path with dynamic dispatch.
> 
> This is an initial (unoptimized) version. We split the path when
> inlining ObjC instance methods. On one branch we always assume that the
> type information for the given memory region is precise. On the other we
> assume that we don't have the exact type info. It is important to check
> since the class could be subclassed and the method can be overridden. If
> we always inline we can loose coverage.
> 
> Had to refactor some of the call eval functions.
> 
> Added:
>    cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m
> Modified:
>    cfe/trunk/include/clang/Frontend/Analyses.def
>    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
>    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
>    cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp
>    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp




More information about the cfe-commits mailing list