]> granicus.if.org Git - clang/commitdiff
Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.
authorZhongxing Xu <xuzhongxing@gmail.com>
Thu, 25 Feb 2010 07:57:35 +0000 (07:57 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Thu, 25 Feb 2010 07:57:35 +0000 (07:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97131 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/CallInliner.cpp
lib/Checker/GRCoreEngine.cpp

index 150102c5ef26c79ba3ba5e9991ff2300c7519313..659d9b8bcfa4c76e48e3147f3b1a4df446e3dd12 100644 (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);
-}
index cbc1cf26216c83339dab0057705efa44345975b7..cc8abc870afb3b18a8b8f2e47bad2aff94fe2939 100644 (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*