[cfe-commits] r161916 - in /cfe/trunk: lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp test/Analysis/inlining/dyn-dispatch-bifurcate.cpp

Jordan Rose jordan_rose at apple.com
Wed Aug 15 09:07:10 PDT 2012


On Aug 14, 2012, at 11:40 PM, Anna Zaks <ganna at apple.com> wrote:

> 
> On Aug 14, 2012, at 5:52 PM, Jordan Rose wrote:
> 
>> Author: jrose
>> Date: Tue Aug 14 19:52:00 2012
>> New Revision: 161916
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=161916&view=rev
>> Log:
>> [analyzer] Don't inline dynamic-dispatch methods unless -analyzer-ipa=dynamic.
>> 
>> Previously we were checking -analyzer-ipa=dynamic-bifurcate only, and
>> unconditionally inlining everything else that had an available definition,
>> even under -analyzer-ipa=inlining (but not under -analyzer-ipa=none).
>> 
> 
> We were not inlining ObjC unless dynamic dispatch or dynamic dispatch bifurcate is turned on due to this check in ExprEngine::inlineCall. It's just not wired for C++.
>  case CE_ObjCMessage:
>    if (!(getAnalysisManager().IPAMode == DynamicDispatch ||
>          getAnalysisManager().IPAMode == DynamicDispatchBifurcate))
>      return false;
> 
> That said, I think checking the flag earlier is better especially since we'll be handing more languages now.

Oops, my fault for not searching for all uses of the flag. I guess there is the question of whether a message is always inlineable (i.e. under -analyzer-ipa=inlining) if we believe we know the exact class of the object (i.e. not a subclass). Right now it is for C++ and isn't for Objective-C. (Then again, right now we only make that assumption for C++ in the case where we are 100% sure -- when the base region is a TypedValueRegion.)

Jordan



More information about the cfe-commits mailing list