diff options
Diffstat (limited to 'lib/Analysis/BasicValueFactory.cpp')
-rw-r--r-- | lib/Analysis/BasicValueFactory.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Analysis/BasicValueFactory.cpp b/lib/Analysis/BasicValueFactory.cpp index 72ad0a5ed8..5ed6d22769 100644 --- a/lib/Analysis/BasicValueFactory.cpp +++ b/lib/Analysis/BasicValueFactory.cpp @@ -23,6 +23,13 @@ void CompoundValData::Profile(llvm::FoldingSetNodeID& ID, QualType T, ID.AddPointer(L.getInternalPointer()); } +void LazyCompoundValData::Profile(llvm::FoldingSetNodeID& ID, + const GRState *state, + const TypedRegion *region) { + ID.AddPointer(state); + ID.AddPointer(region); +} + typedef std::pair<SVal, uintptr_t> SValData; typedef std::pair<SVal, SVal> SValPair; @@ -116,6 +123,25 @@ BasicValueFactory::getCompoundValData(QualType T, return D; } +const LazyCompoundValData* +BasicValueFactory::getLazyCompoundValData(const GRState *state, + const TypedRegion *region) { + llvm::FoldingSetNodeID ID; + LazyCompoundValData::Profile(ID, state, region); + void* InsertPos; + + LazyCompoundValData *D = + LazyCompoundValDataSet.FindNodeOrInsertPos(ID, InsertPos); + + if (!D) { + D = (LazyCompoundValData*) BPAlloc.Allocate<LazyCompoundValData>(); + new (D) LazyCompoundValData(state, region); + LazyCompoundValDataSet.InsertNode(D, InsertPos); + } + + return D; +} + const llvm::APSInt* BasicValueFactory::EvaluateAPSInt(BinaryOperator::Opcode Op, const llvm::APSInt& V1, const llvm::APSInt& V2) { |