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

David Blaikie dblaikie at gmail.com
Thu Dec 6 11:21:07 PST 2012


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...

>    }
>
>    /// addPredeccessor - Adds a predecessor to the current node, and
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list