aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ValueManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/ValueManager.cpp')
-rw-r--r--lib/Analysis/ValueManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Analysis/ValueManager.cpp b/lib/Analysis/ValueManager.cpp
index 724a2e92d7..c9e24223df 100644
--- a/lib/Analysis/ValueManager.cpp
+++ b/lib/Analysis/ValueManager.cpp
@@ -118,6 +118,22 @@ SVal ValueManager::getConjuredSymbolVal(const Expr* E, QualType T,
return UnknownVal();
}
+
+SVal ValueManager::getDerivedRegionValueSymbolVal(SymbolRef parentSymbol,
+ const TypedRegion *R) {
+ SymbolRef sym = SymMgr.getDerivedSymbol(parentSymbol, R);
+
+ QualType T = R->getValueType(R->getContext());
+
+ if (Loc::IsLocType(T))
+ return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
+
+ if (T->isIntegerType() && T->isScalarType())
+ return nonloc::SymbolVal(sym);
+
+ return UnknownVal();
+}
+
SVal ValueManager::getFunctionPointer(const FunctionDecl* FD) {
CodeTextRegion* R
= MemMgr.getCodeTextRegion(FD, Context.getPointerType(FD->getType()));