Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.

llvm-svn: 97131
This commit is contained in:
Zhongxing Xu 2010-02-25 07:57:35 +00:00
parent 62702da070
commit ee29cc3b66
2 changed files with 7 additions and 16 deletions

View File

@ -26,7 +26,6 @@ public:
}
virtual bool EvalCallExpr(CheckerContext &C, const CallExpr *CE);
virtual void EvalEndPath(GREndPathNodeBuilder &B,void *tag,GRExprEngine &Eng);
};
}
@ -53,17 +52,3 @@ bool CallInliner::EvalCallExpr(CheckerContext &C, const CallExpr *CE) {
return true;
}
void CallInliner::EvalEndPath(GREndPathNodeBuilder &B, void *tag,
GRExprEngine &Eng) {
const GRState *state = B.getState();
ExplodedNode *Pred = B.getPredecessor();
const StackFrameContext *LocCtx =
cast<StackFrameContext>(Pred->getLocationContext());
// Check if this is the top level stack frame.
if (!LocCtx->getParent())
return;
B.GenerateCallExitNode(state);
}

View File

@ -612,7 +612,13 @@ GRSwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) {
GREndPathNodeBuilder::~GREndPathNodeBuilder() {
// Auto-generate an EOP node if one has not been generated.
if (!HasGeneratedNode) generateNode(Pred->State);
if (!HasGeneratedNode) {
// If we are in an inlined call, generate CallExit node.
if (Pred->getLocationContext()->getParent())
GenerateCallExitNode(Pred->State);
else
generateNode(Pred->State);
}
}
ExplodedNode*