aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h5
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h5
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h15
-rw-r--r--include/clang/Analysis/PathSensitive/RValues.h6
4 files changed, 26 insertions, 5 deletions
diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index 871d765bd3..b6e31b9ffe 100644
--- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -203,7 +203,10 @@ protected:
friend class GRSwitchNodeBuilderImpl;
// Type definitions.
- typedef llvm::DenseMap<ProgramPoint,void*> EdgeNodeSetMap;
+ typedef llvm::DenseMap<ProgramPoint,
+ llvm::FoldingSet<clang::ExplodedNodeImpl>*>
+ EdgeNodeSetMap;
+
typedef llvm::SmallVector<ExplodedNodeImpl*,2> RootsTy;
typedef llvm::SmallVector<ExplodedNodeImpl*,10> EndNodesTy;
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index ffb4420965..a52a776a1d 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -335,5 +335,10 @@ public:
LValue LHS, NonLValue RHS) {
return TF->EvalBinaryOp(ValMgr, Op, LHS, RHS);
}
+
+ inline RValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+ RValue LHS, RValue RHS) {
+ return TF->EvalBinaryOp(ValMgr, Op, LHS, RHS);
+ }
};
} // end clang namespace \ No newline at end of file
diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
index 87ff170372..19e87dcd94 100644
--- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
+++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
@@ -47,12 +47,25 @@ public:
BinaryOperator::Opcode Op,
LValue LHS, LValue RHS);
-
// Pointer arithmetic.
virtual LValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
LValue LHS, NonLValue RHS) = 0;
+ inline RValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
+ const RValue& L, const RValue& R) {
+
+ if (isa<LValue>(L)) {
+ if (isa<LValue>(R))
+ return EvalBinaryOp(ValMgr, Op, cast<LValue>(L), cast<LValue>(R));
+ else
+ return EvalBinaryOp(ValMgr, Op, cast<LValue>(L), cast<NonLValue>(R));
+ }
+ else
+ return EvalBinaryOp(ValMgr, Op, cast<NonLValue>(L), cast<NonLValue>(R));
+ }
+
+
// Equality operators for LValues.
virtual NonLValue EvalEQ(ValueManager& ValMgr, LValue LHS, LValue RHS) = 0;
virtual NonLValue EvalNE(ValueManager& ValMgr, LValue LHS, LValue RHS) = 0;
diff --git a/include/clang/Analysis/PathSensitive/RValues.h b/include/clang/Analysis/PathSensitive/RValues.h
index acf841170d..319270759f 100644
--- a/include/clang/Analysis/PathSensitive/RValues.h
+++ b/include/clang/Analysis/PathSensitive/RValues.h
@@ -474,10 +474,10 @@ namespace lval {
class DeclVal : public LValue {
public:
- DeclVal(const ValueDecl* vd) : LValue(DeclValKind,vd) {}
+ DeclVal(const VarDecl* vd) : LValue(DeclValKind, vd) {}
- ValueDecl* getDecl() const {
- return static_cast<ValueDecl*>(Data);
+ VarDecl* getDecl() const {
+ return static_cast<VarDecl*>(Data);
}
inline bool operator==(const DeclVal& R) const {