aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/StaticAnalyzer')
-rw-r--r--lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/ProgramState.cpp4
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp b/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
index d9edab8ede..d8bb5ea7a5 100644
--- a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
+++ b/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
@@ -68,7 +68,7 @@ void DynamicTypePropagation::checkPostCall(const CallEvent &Call,
return;
QualType DynResTy =
C.getASTContext().getObjCObjectPointerType(QualType(ObjTy, 0));
- C.addTransition(State->addDynamicTypeInfo(RetReg, DynResTy));
+ C.addTransition(State->setDynamicTypeInfo(RetReg, DynResTy));
break;
}
case OMF_init: {
@@ -78,7 +78,7 @@ void DynamicTypePropagation::checkPostCall(const CallEvent &Call,
if (!RecReg)
return;
DynamicTypeInfo RecDynType = State->getDynamicTypeInfo(RecReg);
- C.addTransition(State->addDynamicTypeInfo(RetReg, RecDynType));
+ C.addTransition(State->setDynamicTypeInfo(RetReg, RecDynType));
break;
}
}
@@ -98,7 +98,7 @@ void DynamicTypePropagation::checkPostStmt(const ImplicitCastExpr *CastE,
case CK_BitCast:
// Only handle ObjCObjects for now.
if (const Type *NewTy = getBetterObjCType(CastE, C))
- C.addTransition(C.getState()->addDynamicTypeInfo(ToR, QualType(NewTy,0)));
+ C.addTransition(C.getState()->setDynamicTypeInfo(ToR, QualType(NewTy,0)));
break;
}
return;
diff --git a/lib/StaticAnalyzer/Core/ProgramState.cpp b/lib/StaticAnalyzer/Core/ProgramState.cpp
index c20979bddb..0e5ff785bf 100644
--- a/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ b/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -762,12 +762,10 @@ DynamicTypeInfo ProgramState::getDynamicTypeInfo(const MemRegion *Reg) const {
return DynamicTypeInfo();
}
-ProgramStateRef ProgramState::addDynamicTypeInfo(const MemRegion *Reg,
+ProgramStateRef ProgramState::setDynamicTypeInfo(const MemRegion *Reg,
DynamicTypeInfo NewTy) const {
if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(Reg)) {
SymbolRef Sym = SR->getSymbol();
- // TODO: Instead of resetting the type info, check the old type info and
- // merge and pick the most precise type.
ProgramStateRef NewState = set<DynamicTypeMap>(Sym, NewTy);
assert(NewState);
return NewState;