aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-27 10:45:02 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-27 10:45:02 +0000
commit4ebdf5c4f587daef4e0be499802eac3a7a49bf2f (patch)
tree2c5a83521a20c02e7805581a174008aa9bc23579 /include/clang/Analysis
parentf698f7e71940663e26a4806a96fb0bdfa160c886 (diff)
Notes
Diffstat (limited to 'include/clang/Analysis')
-rw-r--r--include/clang/Analysis/LocalCheckers.h1
-rw-r--r--include/clang/Analysis/PathSensitive/ConstraintManager.h2
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h37
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h155
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h45
-rw-r--r--include/clang/Analysis/PathSensitive/SVals.h7
-rw-r--r--include/clang/Analysis/PathSensitive/SValuator.h55
-rw-r--r--include/clang/Analysis/PathSensitive/Store.h5
-rw-r--r--include/clang/Analysis/PathSensitive/SymbolManager.h5
-rw-r--r--include/clang/Analysis/PathSensitive/ValueManager.h8
10 files changed, 121 insertions, 199 deletions
diff --git a/include/clang/Analysis/LocalCheckers.h b/include/clang/Analysis/LocalCheckers.h
index 23610f9a2d97..9ff3f52f89aa 100644
--- a/include/clang/Analysis/LocalCheckers.h
+++ b/include/clang/Analysis/LocalCheckers.h
@@ -37,7 +37,6 @@ void CheckDeadStores(LiveVariables& L, BugReporter& BR);
void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
bool FullUninitTaint=false);
-GRTransferFuncs* MakeGRSimpleValsTF();
GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
const LangOptions& lopts);
diff --git a/include/clang/Analysis/PathSensitive/ConstraintManager.h b/include/clang/Analysis/PathSensitive/ConstraintManager.h
index eb519e0e7431..689bebb450f4 100644
--- a/include/clang/Analysis/PathSensitive/ConstraintManager.h
+++ b/include/clang/Analysis/PathSensitive/ConstraintManager.h
@@ -45,7 +45,7 @@ public:
virtual const GRState *RemoveDeadBindings(const GRState *state,
SymbolReaper& SymReaper) = 0;
- virtual void print(const GRState *state, std::ostream& Out,
+ virtual void print(const GRState *state, llvm::raw_ostream& Out,
const char* nl, const char *sep) = 0;
virtual void EndPath(const GRState *state) {}
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index 5db666c4b83f..f05bc680a7e2 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -20,6 +20,7 @@
#include "clang/Analysis/PathSensitive/GRState.h"
#include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h"
#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
+#include "clang/Analysis/PathSensitive/SValuator.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/AST/Type.h"
#include "clang/AST/ExprObjC.h"
@@ -67,6 +68,9 @@ protected:
/// ValMgr - Object that manages/creates SVals.
ValueManager &ValMgr;
+ /// SVator - SValuator object that creates SVals from expressions.
+ llvm::OwningPtr<SValuator> SVator;
+
/// EntryNode - The immediate predecessor node.
NodeTy* EntryNode;
@@ -603,41 +607,32 @@ protected:
return X;
if (isa<Loc>(X))
- return getTF().EvalCast(*this, cast<Loc>(X), CastT);
+ return SVator->EvalCast(cast<Loc>(X), CastT);
else
- return getTF().EvalCast(*this, cast<NonLoc>(X), CastT);
+ return SVator->EvalCast(cast<NonLoc>(X), CastT);
}
- SVal EvalMinus(UnaryOperator* U, SVal X) {
- return X.isValid() ? getTF().EvalMinus(*this, U, cast<NonLoc>(X)) : X;
+ SVal EvalMinus(SVal X) {
+ return X.isValid() ? SVator->EvalMinus(cast<NonLoc>(X)) : X;
}
SVal EvalComplement(SVal X) {
- return X.isValid() ? getTF().EvalComplement(*this, cast<NonLoc>(X)) : X;
+ return X.isValid() ? SVator->EvalComplement(cast<NonLoc>(X)) : X;
}
public:
- SVal EvalBinOp(BinaryOperator::Opcode Op, NonLoc L, NonLoc R, QualType T) {
- return R.isValid() ? getTF().DetermEvalBinOpNN(*this, Op, L, R, T)
- : R;
+ SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T) {
+ return SVator->EvalBinOpNN(op, L, R, T);
}
- SVal EvalBinOp(BinaryOperator::Opcode Op, NonLoc L, SVal R, QualType T) {
- return R.isValid() ? getTF().DetermEvalBinOpNN(*this, Op, L,
- cast<NonLoc>(R), T) : R;
+ SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T) {
+ return R.isValid() ? SVator->EvalBinOpNN(op, L, cast<NonLoc>(R), T) : R;
}
- void EvalBinOp(ExplodedNodeSet<GRState>& Dst, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R,
- ExplodedNode<GRState>* Pred, QualType T);
-
- void EvalBinOp(GRStateSet& OStates, const GRState* St, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R, QualType T);
-
- SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op, SVal L,SVal R,
- QualType T);
-
+ SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode op,
+ SVal lhs, SVal rhs, QualType T);
+
protected:
void EvalCall(NodeSet& Dst, CallExpr* CE, SVal L, NodeTy* Pred);
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index 98f1242ad81e..0da8f5243e9c 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -34,7 +34,7 @@
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include <functional>
@@ -199,6 +199,14 @@ public:
bool assumption) const;
//==---------------------------------------------------------------------==//
+ // Utility methods for getting regions.
+ //==---------------------------------------------------------------------==//
+
+ const VarRegion* getRegion(const VarDecl* D) const;
+
+ const MemRegion* getSelfRegion() const;
+
+ //==---------------------------------------------------------------------==//
// Binding and retrieving values to/from the environment and symbolic store.
//==---------------------------------------------------------------------==//
@@ -218,6 +226,10 @@ public:
return bindExpr(Ex, V, true, false);
}
+ const GRState *bindDecl(const VarDecl* VD, SVal IVal) const;
+
+ const GRState *bindDeclWithNoInit(const VarDecl* VD) const;
+
const GRState *bindLoc(Loc location, SVal V) const;
const GRState *bindLoc(SVal location, SVal V) const;
@@ -314,17 +326,17 @@ public:
class Printer {
public:
virtual ~Printer() {}
- virtual void Print(std::ostream& Out, const GRState* state,
+ virtual void Print(llvm::raw_ostream& Out, const GRState* state,
const char* nl, const char* sep) = 0;
};
// Pretty-printing.
- void print(std::ostream& Out, const char *nl = "\n",
+ void print(llvm::raw_ostream& Out, const char *nl = "\n",
const char *sep = "") const;
void printStdErr() const;
- void printDOT(std::ostream& Out) const;
+ void printDOT(llvm::raw_ostream& Out) const;
// Tags used for the Generic Data Map.
struct NullDerefTag {
@@ -427,18 +439,7 @@ private:
/// Liveness - live-variables information of the ValueDecl* and block-level
/// Expr* in the CFG. Used to get initial store and prune out dead state.
LiveVariables& Liveness;
-
-private:
-
- Environment RemoveBlkExpr(const Environment& Env, Expr* E) {
- return EnvMgr.RemoveBlkExpr(Env, E);
- }
- // FIXME: Remove when we do lazy initializaton of variable bindings.
-// const GRState* BindVar(const GRState* St, VarDecl* D, SVal V) {
-// return SetSVal(St, getLoc(D), V);
-// }
-
public:
GRStateManager(ASTContext& Ctx,
@@ -460,7 +461,7 @@ public:
~GRStateManager();
- const GRState* getInitialState();
+ const GRState *getInitialState();
ASTContext &getContext() { return ValueMgr.getContext(); }
const ASTContext &getContext() const { return ValueMgr.getContext(); }
@@ -498,16 +499,6 @@ public:
StoreManager& getStoreManager() { return *StoreMgr; }
ConstraintManager& getConstraintManager() { return *ConstraintMgr; }
- const GRState* BindDecl(const GRState* St, const VarDecl* VD, SVal IVal) {
- // Store manager should return a persistent state.
- return StoreMgr->BindDecl(St, VD, IVal);
- }
-
- const GRState* BindDeclWithNoInit(const GRState* St, const VarDecl* VD) {
- // Store manager should return a persistent state.
- return StoreMgr->BindDeclWithNoInit(St, VD);
- }
-
const GRState* RemoveDeadBindings(const GRState* St, Stmt* Loc,
SymbolReaper& SymReaper);
@@ -516,55 +507,7 @@ public:
NewSt.Env = EnvMgr.RemoveSubExprBindings(NewSt.Env);
return getPersistentState(NewSt);
}
-
-
- // Utility methods for getting regions.
-
- VarRegion* getRegion(const VarDecl* D) {
- return getRegionManager().getVarRegion(D);
- }
-
- const MemRegion* getSelfRegion(const GRState* state) {
- return StoreMgr->getSelfRegion(state->getStore());
- }
-
-private:
-
- SVal GetBlkExprSVal(const GRState* St, const Stmt* Ex) {
- return St->getEnvironment().GetBlkExprSVal(Ex, ValueMgr);
- }
-
- const GRState* BindExpr(const GRState* St, const Stmt* Ex, SVal V,
- bool isBlkExpr, bool Invalidate) {
-
- const Environment& OldEnv = St->getEnvironment();
- Environment NewEnv = EnvMgr.BindExpr(OldEnv, Ex, V, isBlkExpr, Invalidate);
-
- if (NewEnv == OldEnv)
- return St;
-
- GRState NewSt = *St;
- NewSt.Env = NewEnv;
- return getPersistentState(NewSt);
- }
- const GRState* BindExpr(const GRState* St, const Stmt* Ex, SVal V,
- bool Invalidate = true) {
-
- bool isBlkExpr = false;
-
- if (Ex == CurrentStmt) {
- // FIXME: Should this just be an assertion? When would we want to set
- // the value of a block-level expression if it wasn't CurrentStmt?
- isBlkExpr = cfg.isBlkExpr(Ex);
-
- if (!isBlkExpr)
- return St;
- }
-
- return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
- }
-
public:
SVal ArrayToPointer(Loc Array) {
@@ -579,37 +522,7 @@ public:
void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
StoreMgr->iterBindings(state->getStore(), F);
}
-
- SVal GetSVal(const GRState* state, const MemRegion* R) {
- return StoreMgr->Retrieve(state, loc::MemRegionVal(R));
- }
-
- SVal GetSValAsScalarOrLoc(const GRState* state, const MemRegion *R) {
- // We only want to do fetches from regions that we can actually bind
- // values. For example, SymbolicRegions of type 'id<...>' cannot
- // have direct bindings (but their can be bindings on their subregions).
- if (!R->isBoundable())
- return UnknownVal();
-
- if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
- QualType T = TR->getValueType(getContext());
- if (Loc::IsLocType(T) || T->isIntegerType())
- return GetSVal(state, R);
- }
-
- return UnknownVal();
- }
-
- const GRState* BindLoc(const GRState* St, Loc LV, SVal V) {
- return StoreMgr->Bind(St, LV, V);
- }
- void Unbind(GRState& St, Loc LV) {
- St.St = StoreMgr->Remove(St.St, LV);
- }
-
- const GRState* Unbind(const GRState* St, Loc LV);
-
const GRState* getPersistentState(GRState& Impl);
bool isEqual(const GRState* state, Expr* Ex, const llvm::APSInt& V);
@@ -695,6 +608,14 @@ public:
// Out-of-line method definitions for GRState.
//===----------------------------------------------------------------------===//
+inline const VarRegion* GRState::getRegion(const VarDecl* D) const {
+ return Mgr->getRegionManager().getVarRegion(D);
+}
+
+inline const MemRegion* GRState::getSelfRegion() const {
+ return Mgr->StoreMgr->getSelfRegion(getStore());
+}
+
inline const GRState *GRState::assume(SVal Cond, bool Assumption) const {
return Mgr->ConstraintMgr->Assume(this, Cond, Assumption);
}
@@ -709,18 +630,16 @@ inline const GRState *GRState::bindCompoundLiteral(const CompoundLiteralExpr* CL
return Mgr->StoreMgr->BindCompoundLiteral(this, CL, V);
}
-inline const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool isBlkExpr,
- bool Invalidate) const {
- return Mgr->BindExpr(this, Ex, V, isBlkExpr, Invalidate);
+inline const GRState *GRState::bindDecl(const VarDecl* VD, SVal IVal) const {
+ return Mgr->StoreMgr->BindDecl(this, VD, IVal);
}
-inline const GRState *GRState::bindExpr(const Stmt* Ex, SVal V,
- bool Invalidate) const {
- return Mgr->BindExpr(this, Ex, V, Invalidate);
+inline const GRState *GRState::bindDeclWithNoInit(const VarDecl* VD) const {
+ return Mgr->StoreMgr->BindDeclWithNoInit(this, VD);
}
inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
- return Mgr->BindLoc(this, LV, V);
+ return Mgr->StoreMgr->Bind(this, LV, V);
}
inline const GRState *GRState::bindLoc(SVal LV, SVal V) const {
@@ -756,11 +675,11 @@ inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
}
inline SVal GRState::getSVal(const Stmt* Ex) const {
- return getEnvironment().GetSVal(Ex, Mgr->ValueMgr);
+ return Env.GetSVal(Ex, Mgr->ValueMgr);
}
inline SVal GRState::getBlkExprSVal(const Stmt* Ex) const {
- return Mgr->GetBlkExprSVal(this, Ex);
+ return Env.GetBlkExprSVal(Ex, Mgr->ValueMgr);
}
inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const {
@@ -778,11 +697,7 @@ inline SVal GRState::getSVal(Loc LV, QualType T) const {
}
inline SVal GRState::getSVal(const MemRegion* R) const {
- return Mgr->GetSVal(this, R);
-}
-
-inline SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
- return Mgr->GetSValAsScalarOrLoc(this, R);
+ return Mgr->StoreMgr->Retrieve(this, loc::MemRegionVal(R));
}
inline BasicValueFactory &GRState::getBasicVals() const {
@@ -842,10 +757,6 @@ CB GRState::scanReachableSymbols(SVal val) const {
scanReachableSymbols(val, cb);
return cb;
}
-
-inline const GRState *GRState::unbindLoc(Loc LV) const {
- return Mgr->Unbind(this, LV);
-}
} // end clang namespace
diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
index c2f8f5aae0e9..db23f81e2d67 100644
--- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
+++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
@@ -22,20 +22,12 @@
namespace clang {
- class GRExprEngine;
- class BugReporter;
- class ObjCMessageExpr;
- class GRStmtNodeBuilderRef;
+class GRExprEngine;
+class BugReporter;
+class ObjCMessageExpr;
+class GRStmtNodeBuilderRef;
class GRTransferFuncs {
- friend class GRExprEngine;
-protected:
- virtual SVal DetermEvalBinOpNN(GRExprEngine& Eng,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R, QualType T) {
- return UnknownVal();
- }
-
public:
GRTransferFuncs() {}
virtual ~GRTransferFuncs() {}
@@ -43,33 +35,7 @@ public:
virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
virtual void RegisterChecks(BugReporter& BR) {}
- // Casts.
-
- virtual SVal EvalCast(GRExprEngine& Engine, NonLoc V, QualType CastT) =0;
- virtual SVal EvalCast(GRExprEngine& Engine, Loc V, QualType CastT) = 0;
-
- // Unary Operators.
-
- virtual SVal EvalMinus(GRExprEngine& Engine, UnaryOperator* U, NonLoc X) = 0;
-
- virtual SVal EvalComplement(GRExprEngine& Engine, NonLoc X) = 0;
- // Binary Operators.
- // FIXME: We're moving back towards using GREXprEngine directly. No need
- // for OStates
- virtual void EvalBinOpNN(GRStateSet& OStates, GRExprEngine& Eng,
- const GRState* St, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R,
- QualType T);
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
- Loc L, Loc R) = 0;
-
- // Pointer arithmetic.
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, const GRState *state,
- BinaryOperator::Opcode Op, Loc L, NonLoc R) = 0;
-
// Calls.
virtual void EvalCall(ExplodedNodeSet<GRState>& Dst,
@@ -108,8 +74,7 @@ public:
ReturnStmt* S,
ExplodedNode<GRState>* Pred) {}
- // Assumptions.
-
+ // Assumptions.
virtual const GRState* EvalAssume(const GRState *state,
SVal Cond, bool Assumption) {
return state;
diff --git a/include/clang/Analysis/PathSensitive/SVals.h b/include/clang/Analysis/PathSensitive/SVals.h
index de74dbdb17b0..36137fb117b3 100644
--- a/include/clang/Analysis/PathSensitive/SVals.h
+++ b/include/clang/Analysis/PathSensitive/SVals.h
@@ -111,7 +111,6 @@ public:
/// return that expression. Otherwise return NULL.
const SymExpr *getAsSymbolicExpression() const;
- void print(std::ostream& OS) const;
void print(llvm::raw_ostream& OS) const;
void printStdErr() const;
@@ -255,12 +254,12 @@ public:
}
// Transfer functions for binary/unary operations on ConcreteInts.
- SVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
+ SVal evalBinOp(ValueManager &ValMgr, BinaryOperator::Opcode Op,
const ConcreteInt& R) const;
- ConcreteInt EvalComplement(BasicValueFactory& BasicVals) const;
+ ConcreteInt evalComplement(ValueManager &ValMgr) const;
- ConcreteInt EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U) const;
+ ConcreteInt evalMinus(ValueManager &ValMgr) const;
// Implement isa<T> support.
static inline bool classof(const SVal* V) {
diff --git a/include/clang/Analysis/PathSensitive/SValuator.h b/include/clang/Analysis/PathSensitive/SValuator.h
new file mode 100644
index 000000000000..490c04e5978e
--- /dev/null
+++ b/include/clang/Analysis/PathSensitive/SValuator.h
@@ -0,0 +1,55 @@
+// SValuator.h - Construction of SVals from evaluating expressions -*- C++ -*---
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines SValuator, a class that defines the interface for
+// "symbolical evaluators" which construct an SVal from an expression.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_ANALYSIS_SVALUATOR
+#define LLVM_CLANG_ANALYSIS_SVALUATOR
+
+#include "clang/AST/Expr.h"
+#include "clang/Analysis/PathSensitive/SVals.h"
+
+namespace clang {
+
+class GRState;
+class ValueManager;
+
+class SValuator {
+protected:
+ ValueManager &ValMgr;
+
+public:
+ SValuator(ValueManager &valMgr) : ValMgr(valMgr) {}
+ virtual ~SValuator() {}
+
+ virtual SVal EvalCast(NonLoc val, QualType castTy) = 0;
+
+ virtual SVal EvalCast(Loc val, QualType castTy) = 0;
+
+ virtual SVal EvalMinus(NonLoc val) = 0;
+
+ virtual SVal EvalComplement(NonLoc val) = 0;
+
+ virtual SVal EvalBinOpNN(BinaryOperator::Opcode Op, NonLoc lhs,
+ NonLoc rhs, QualType resultTy) = 0;
+
+ virtual SVal EvalBinOpLL(BinaryOperator::Opcode Op, Loc lhs, Loc rhs,
+ QualType resultTy) = 0;
+
+ virtual SVal EvalBinOpLN(const GRState *state, BinaryOperator::Opcode Op,
+ Loc lhs, NonLoc rhs, QualType resultTy) = 0;
+};
+
+SValuator* CreateSimpleSValuator(ValueManager &valMgr);
+
+} // end clang namespace
+#endif
diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h
index 0c5df2e98e17..5aa53507fd14 100644
--- a/include/clang/Analysis/PathSensitive/Store.h
+++ b/include/clang/Analysis/PathSensitive/Store.h
@@ -21,7 +21,6 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
-#include <iosfwd>
namespace clang {
@@ -139,7 +138,7 @@ public:
/// EvalBinOp - Perform pointer arithmetic.
virtual SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,
- Loc lhs, NonLoc rhs) {
+ Loc lhs, NonLoc rhs, QualType resultTy) {
return UnknownVal();
}
@@ -171,7 +170,7 @@ public:
return state;
}
- virtual void print(Store store, std::ostream& Out,
+ virtual void print(Store store, llvm::raw_ostream& Out,
const char* nl, const char *sep) = 0;
class BindingsHandler {
diff --git a/include/clang/Analysis/PathSensitive/SymbolManager.h b/include/clang/Analysis/PathSensitive/SymbolManager.h
index d074e30333d4..f32a7e3481dd 100644
--- a/include/clang/Analysis/PathSensitive/SymbolManager.h
+++ b/include/clang/Analysis/PathSensitive/SymbolManager.h
@@ -328,9 +328,4 @@ namespace llvm {
llvm::raw_ostream& operator<<(llvm::raw_ostream& Out,
const clang::SymExpr *SE);
}
-namespace std {
- std::ostream& operator<<(std::ostream& Out,
- const clang::SymExpr *SE);
-}
-
#endif
diff --git a/include/clang/Analysis/PathSensitive/ValueManager.h b/include/clang/Analysis/PathSensitive/ValueManager.h
index d8e557f76036..de318a0f03e8 100644
--- a/include/clang/Analysis/PathSensitive/ValueManager.h
+++ b/include/clang/Analysis/PathSensitive/ValueManager.h
@@ -87,14 +87,18 @@ public:
return nonloc::ConcreteInt(BasicVals.getZeroWithPtrWidth(false));
}
- NonLoc makeIntVal(const IntegerLiteral* I) {
+ nonloc::ConcreteInt makeIntVal(const IntegerLiteral* I) {
return nonloc::ConcreteInt(BasicVals.getValue(I->getValue(),
I->getType()->isUnsignedIntegerType()));
}
- NonLoc makeIntVal(const llvm::APSInt& V) {
+ nonloc::ConcreteInt makeIntVal(const llvm::APSInt& V) {
return nonloc::ConcreteInt(BasicVals.getValue(V));
}
+
+ loc::ConcreteInt makeIntLocVal(const llvm::APSInt &v) {
+ return loc::ConcreteInt(BasicVals.getValue(v));
+ }
NonLoc makeIntVal(const llvm::APInt& V, bool isUnsigned) {
return nonloc::ConcreteInt(BasicVals.getValue(V, isUnsigned));