[cfe-commits] r45508 - in /cfe/trunk/include/clang/Analysis/PathSensitive: SimulGraph.h SimulVertex.h
Ted Kremenek
kremenek at apple.com
Wed Jan 2 14:20:21 PST 2008
Author: kremenek
Date: Wed Jan 2 16:20:20 2008
New Revision: 45508
URL: http://llvm.org/viewvc/llvm-project?rev=45508&view=rev
Log:
SimulVertex: Inverted argument order when calling the Profile method of StateTy.
SimulGraph: Inverted argument order when calling the Profile method of VertexTy
(plus minor cleanups)
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SimulGraph.h
cfe/trunk/include/clang/Analysis/PathSensitive/SimulVertex.h
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SimulGraph.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SimulGraph.h?rev=45508&r1=45507&r2=45508&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SimulGraph.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SimulGraph.h Wed Jan 2 16:20:20 2008
@@ -59,9 +59,10 @@
/// getVertex - Retrieve the vertex associated with a (Location,State) pair,
/// where the 'Location' is a ProgramEdge in the CFG. If no vertex for
/// this pair exists, it is created.
- VertexTy* getVertex(ProgramEdge Loc, typename VertexTy::StateTy* State) {
+ VertexTy* getVertex(const ProgramEdge& L, typename VertexTy::StateTy State) {
+
// Retrieve the vertex set associated with Loc.
- VertexSet& VSet = VerticesOfEdge[Loc];
+ VertexSet& VSet = VerticesOfEdge[L];
// Profile 'State' to determine if we already have an existing vertex.
// Note: this assumes that a vertex's profile matches with its state,
@@ -71,14 +72,14 @@
void* InsertPos = 0;
VertexTy* V = 0;
- typename VertexTy::StateTy::Profile(profile,State);
+ VertexTy::StateTy::Profile(profile, State);
- if (V = VSet.FindNodeOrInsertPos(profile,InsertPos))
+ if ((V = VSet.FindNodeOrInsertPos(profile,InsertPos)))
return V;
// No cache hit. Allocate a new vertex.
V = (VertexTy*) Allocator.Allocate<VertexTy>();
- new (V) VertexTy(VertexCounter++,Loc,State);
+ new (V) VertexTy(VertexCounter++,L,State);
// Insert the vertex into the vertex set and return it.
VSet.InsertNode(V,InsertPos);
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SimulVertex.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SimulVertex.h?rev=45508&r1=45507&r2=45508&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SimulVertex.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SimulVertex.h Wed Jan 2 16:20:20 2008
@@ -57,7 +57,7 @@
AdjacentVertices Succs;
public:
- explicit SimulVertex(unsigned ID, const ProgramEdge& loc, StateTy& state)
+ explicit SimulVertex(unsigned ID, const ProgramEdge& loc, StateTy state)
: VertexID(ID), Location(loc), State(state) {}
// Accessors.
@@ -67,7 +67,7 @@
// Profiling (for FoldingSet).
void Profile(llvm::FoldingSetNodeID& ID) const {
- StateTy::Profile(getState(),ID);
+ StateTy::Profile(ID,getState());
}
// Iterators over successor and predecessor vertices.
More information about the cfe-commits
mailing list