aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive/ExplodedGraph.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-30 23:03:39 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-30 23:03:39 +0000
commitb38911f16b4943548db6a3695fc6ae23070b25d2 (patch)
tree5a08a4005940740a34242c4ee32e69902a9e840a /include/clang/Analysis/PathSensitive/ExplodedGraph.h
parenta292585207adbf6dcf6347db3526a7ec861d8eac (diff)
Implemented some branch pruning in GRConstants using != and == for
constant integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/ExplodedGraph.h')
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index dc96c1c5a4..e69acda3e3 100644
--- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -43,15 +43,15 @@ protected:
friend class GRBranchNodeBuilderImpl;
class NodeGroup {
- enum { Size1 = 0x0, SizeOther = 0x1, Infeasible = 0x2, Flags = 0x3 };
+ enum { Size1 = 0x0, SizeOther = 0x1, AuxFlag = 0x2, Mask = 0x3 };
uintptr_t P;
unsigned getKind() const {
- return P & Flags;
+ return P & Mask;
}
void* getPtr() const {
- return reinterpret_cast<void*>(P & ~Flags);
+ return reinterpret_cast<void*>(P & ~Mask);
}
ExplodedNodeImpl* getNode() const {
@@ -73,15 +73,14 @@ protected:
void addNode(ExplodedNodeImpl* N);
- void setInfeasibleFlag() {
- P |= Infeasible;
+ void setFlag() {
+ P |= AuxFlag;
}
- bool getInfeasibleFlag() const {
- return P & Infeasible ? true : false;
+ bool getFlag() const {
+ return P & AuxFlag ? true : false;
}
- };
-
+ };
/// Location - The program location (within a function body) associated
/// with this node.
@@ -105,7 +104,7 @@ protected:
/// addPredeccessor - Adds a predecessor to the current node, and
/// in tandem add this node as a successor of the other node.
void addPredecessor(ExplodedNodeImpl* V) {
- assert (!V->isInfeasible());
+ assert (!V->isSink());
Preds.addNode(V);
V->Succs.addNode(this);
}
@@ -129,8 +128,8 @@ public:
bool succ_empty() const { return Succs.empty(); }
bool pred_empty() const { return Preds.size(); }
- bool isInfeasible() const { return Preds.getInfeasibleFlag(); }
- void setInfeasible() { Preds.setInfeasibleFlag(); }
+ bool isSink() const { return Preds.getFlag(); }
+ void markAsSink() { Preds.setFlag(); }
};