[cfe-commits] r160767 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp test/Analysis/misc-ps-cxx0x.cpp

Jordan Rose jordan_rose at apple.com
Fri Jul 27 10:17:29 PDT 2012


On Jul 26, 2012, at 10:34 , Ted Kremenek <kremenek at apple.com> wrote:

>>> // Don't check for uninitialized field values in arguments if the
>>> // caller has a body that is available and we have the chance to inline it.
>>> // This is a hack, but is a reasonable compromise betweens sometimes warning
>>> // and sometimes not depending on if we decide to inline a function.
>>> const Decl *D = Call.getDecl();
>>> const bool checkUninitFields =
>>> -    !(C.getAnalysisManager().shouldInlineCall() &&
>>> -      (D && D->getBody()));
>>> +    !(C.getAnalysisManager().shouldInlineCall() && (D && D->getBody())); 
>> 
>> Yeah, this should be refactored into CallEvent anyway, either CallEvent::mayBeInlined or CallEvent::willBeInlined. The test is wrong because a CallEvent's decl is often not the decl with the definition.
> 
> Interesting.  All I did was change the indentation.  Perhaps something like "Call.getDefininingDecl()" which returns the correct Decl* if it exists?

Anna's recent simplification of getDefinition (and name change to getRuntimeDefinition) does maybe 80% of this. The remaining 20% is the other conditions we check in ExprEngine::inlineCall and ExprEngine::shouldInlineDecl. This is already on my queue (from Anna's comments a week ago).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120727/aec2247c/attachment.html>


More information about the cfe-commits mailing list