On Dec 6, 2012, at 11:21 , David Blaikie <[email protected]> wrote:

> On Thu, Dec 6, 2012 at 10:58 AM, Jordan Rose <[email protected]> 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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to