forked from OSchip/llvm-project
Add initial support for C++ delete expr.
llvm-svn: 101980
This commit is contained in:
parent
9c8cd8c061
commit
d80755dac2
|
@ -364,6 +364,9 @@ public:
|
||||||
void VisitCXXNewExpr(CXXNewExpr *CNE, ExplodedNode *Pred,
|
void VisitCXXNewExpr(CXXNewExpr *CNE, ExplodedNode *Pred,
|
||||||
ExplodedNodeSet &Dst);
|
ExplodedNodeSet &Dst);
|
||||||
|
|
||||||
|
void VisitCXXDeleteExpr(CXXDeleteExpr *CDE, ExplodedNode *Pred,
|
||||||
|
ExplodedNodeSet &Dst);
|
||||||
|
|
||||||
void VisitAggExpr(const Expr *E, SVal Dest, ExplodedNode *Pred,
|
void VisitAggExpr(const Expr *E, SVal Dest, ExplodedNode *Pred,
|
||||||
ExplodedNodeSet &Dst);
|
ExplodedNodeSet &Dst);
|
||||||
|
|
||||||
|
|
|
@ -220,9 +220,20 @@ void GRExprEngine::VisitCXXNewExpr(CXXNewExpr *CNE, ExplodedNode *Pred,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GRExprEngine::VisitCXXDeleteExpr(CXXDeleteExpr *CDE, ExplodedNode *Pred,
|
||||||
|
ExplodedNodeSet &Dst) {
|
||||||
|
// Should do more checking.
|
||||||
|
ExplodedNodeSet ArgEvaluated;
|
||||||
|
Visit(CDE->getArgument(), Pred, ArgEvaluated);
|
||||||
|
for (ExplodedNodeSet::iterator I = ArgEvaluated.begin(),
|
||||||
|
E = ArgEvaluated.end(); I != E; ++I) {
|
||||||
|
const GRState *state = GetState(*I);
|
||||||
|
MakeNode(Dst, CDE, *I, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GRExprEngine::VisitCXXThisExpr(CXXThisExpr *TE, ExplodedNode *Pred,
|
void GRExprEngine::VisitCXXThisExpr(CXXThisExpr *TE, ExplodedNode *Pred,
|
||||||
ExplodedNodeSet & Dst) {
|
ExplodedNodeSet &Dst) {
|
||||||
// Get the this object region from StoreManager.
|
// Get the this object region from StoreManager.
|
||||||
const MemRegion *R =
|
const MemRegion *R =
|
||||||
ValMgr.getRegionManager().getCXXThisRegion(
|
ValMgr.getRegionManager().getCXXThisRegion(
|
||||||
|
|
|
@ -589,7 +589,6 @@ void GRExprEngine::Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst) {
|
||||||
case Stmt::CXXCatchStmtClass:
|
case Stmt::CXXCatchStmtClass:
|
||||||
case Stmt::CXXConstructExprClass:
|
case Stmt::CXXConstructExprClass:
|
||||||
case Stmt::CXXDefaultArgExprClass:
|
case Stmt::CXXDefaultArgExprClass:
|
||||||
case Stmt::CXXDeleteExprClass:
|
|
||||||
case Stmt::CXXDependentScopeMemberExprClass:
|
case Stmt::CXXDependentScopeMemberExprClass:
|
||||||
case Stmt::CXXExprWithTemporariesClass:
|
case Stmt::CXXExprWithTemporariesClass:
|
||||||
case Stmt::CXXNamedCastExprClass:
|
case Stmt::CXXNamedCastExprClass:
|
||||||
|
@ -724,6 +723,11 @@ void GRExprEngine::Visit(Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Stmt::CXXDeleteExprClass: {
|
||||||
|
CXXDeleteExpr *CDE = cast<CXXDeleteExpr>(S);
|
||||||
|
VisitCXXDeleteExpr(CDE, Pred, Dst);
|
||||||
|
break;
|
||||||
|
}
|
||||||
// FIXME: ChooseExpr is really a constant. We need to fix
|
// FIXME: ChooseExpr is really a constant. We need to fix
|
||||||
// the CFG do not model them as explicit control-flow.
|
// the CFG do not model them as explicit control-flow.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue