aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive/BasicValueFactory.h
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-10-30 04:58:00 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-10-30 04:58:00 +0000
commit6764b72f6f26b5c03471b9e379a44d379d2d4a9e (patch)
treeca1267933cd471c1976f4bcd2bc784590f0d14d8 /include/clang/Analysis/PathSensitive/BasicValueFactory.h
parentbed311564e4cbaeecd6de20c2f0ab8e348f932b1 (diff)
Add CompoundVal and CompoundValData for representing the value of InitListExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/BasicValueFactory.h')
-rw-r--r--include/clang/Analysis/PathSensitive/BasicValueFactory.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/include/clang/Analysis/PathSensitive/BasicValueFactory.h
index 0edcde35bc..8d4ff9e541 100644
--- a/include/clang/Analysis/PathSensitive/BasicValueFactory.h
+++ b/include/clang/Analysis/PathSensitive/BasicValueFactory.h
@@ -28,7 +28,24 @@ namespace llvm {
namespace clang {
class SVal;
-
+
+class CompoundValData : public llvm::FoldingSetNode {
+ QualType T;
+ unsigned NumVals;
+ SVal* Vals;
+
+public:
+ CompoundValData(QualType t, const SVal* vals, unsigned n,
+ llvm::BumpPtrAllocator& A);
+
+ static void Profile(llvm::FoldingSetNodeID& ID, QualType T, unsigned N,
+ const SVal* Vals);
+
+ void Profile(llvm::FoldingSetNodeID& ID) {
+ Profile(ID, T, NumVals, Vals);
+ }
+};
+
class BasicValueFactory {
typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt> >
APSIntSetTy;
@@ -45,6 +62,8 @@ class BasicValueFactory {
void* PersistentSVals;
void* PersistentSValPairs;
+ llvm::FoldingSet<CompoundValData> CompoundValDataSet;
+
public:
BasicValueFactory(ASTContext& ctx, llvm::BumpPtrAllocator& Alloc)
: Ctx(ctx), BPAlloc(Alloc), PersistentSVals(0), PersistentSValPairs(0) {}
@@ -68,6 +87,9 @@ public:
const SymIntConstraint& getConstraint(SymbolID sym, BinaryOperator::Opcode Op,
const llvm::APSInt& V);
+ const CompoundValData* getCompoundValData(QualType T, const SVal* Vals,
+ unsigned NumVals);
+
const llvm::APSInt* EvaluateAPSInt(BinaryOperator::Opcode Op,
const llvm::APSInt& V1,
const llvm::APSInt& V2);