[cfe-commits] r169525 - /cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h

Jordan Rose jordan_rose at apple.com
Thu Dec 6 11:27:22 PST 2012


On Dec 6, 2012, at 11:21 , David Blaikie <dblaikie at gmail.com> wrote:

> On Thu, Dec 6, 2012 at 10:58 AM, Jordan Rose <jordan_rose at apple.com> wrote:
>> Author: jrose
>> Date: Thu Dec  6 12:58:12 2012
>> New Revision: 169525
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=169525&view=rev
>> Log:
>> [analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.
>> 
>> ProgramStateRef::Retain isn't free!
>> 
>> Modified:
>>    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
>> 
>> Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h?rev=169525&r1=169524&r2=169525&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h (original)
>> +++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h Thu Dec  6 12:58:12 2012
>> @@ -174,7 +174,8 @@
>>   }
>> 
>>   void Profile(llvm::FoldingSetNodeID& ID) const {
>> -    Profile(ID, getLocation(), getState(), isSink());
>> +    // We avoid copy constructors by not using accessors.
>> +    Profile(ID, Location, State, isSink());
> 
> Shouldn't getState just return a const ProgramStateRef &? That would
> fix this issue & any similar ones that might crop up (even ones in
> non-private usages that couldn't be updated to use the internal member
> directly) I think...

Hm, it feels weird to have a reference to a reference, but it wouldn't hurt anything. Okay.



More information about the cfe-commits mailing list