[cfe-commits] r169589 - /cfe/trunk/lib/StaticAnalyzer/Core/CallEvent.cpp

Ted Kremenek kremenek at apple.com
Fri Dec 7 10:05:15 PST 2012


On Dec 7, 2012, at 9:47 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> Yuck. Can we push this up to ASTContext or AnalysisManager?

It doesn't belong in ASTContext, unless it is a general optimization for all clients.

Pushing to AnalysisManager seems reasonable.

> 
> Also, it seems like a waste to double the size of every value in the map by using Optional, even if you would otherwise need to do two lookups (first find() and then insert()) in the slow case.

Two lookups would be noticeably slower.  I also suspect the memory overhead is inconsequential.  We are talking about a few kilobytes at most, on a very complicated file.  We can bit-mangle the pointer, if you like, to provide a sentinel value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121207/05808c4b/attachment.html>


More information about the cfe-commits mailing list