From: Zhongxing Xu Date: Thu, 25 Feb 2010 07:57:35 +0000 (+0000) Subject: Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f710691a5a15795e186632ddd62cb0097bb67302;p=clang Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97131 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Checker/CallInliner.cpp b/lib/Checker/CallInliner.cpp index 150102c5ef..659d9b8bcf 100644 --- a/lib/Checker/CallInliner.cpp +++ b/lib/Checker/CallInliner.cpp @@ -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(Pred->getLocationContext()); - // Check if this is the top level stack frame. - if (!LocCtx->getParent()) - return; - - B.GenerateCallExitNode(state); -} diff --git a/lib/Checker/GRCoreEngine.cpp b/lib/Checker/GRCoreEngine.cpp index cbc1cf2621..cc8abc870a 100644 --- a/lib/Checker/GRCoreEngine.cpp +++ b/lib/Checker/GRCoreEngine.cpp @@ -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*