]> granicus.if.org Git - clang/commitdiff
[analyzer] Rename CallEvent::mayBeInlined to CallEvent::isCallStmt.
authorJordan Rose <jordan_rose@apple.com>
Tue, 28 Aug 2012 00:50:38 +0000 (00:50 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 28 Aug 2012 00:50:38 +0000 (00:50 +0000)
The two callers are using this in order to be conservative, so let's just
clarify the information that's actually being provided here. This is not
related to inlining decisions in any way.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162717 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
lib/StaticAnalyzer/Core/CallEvent.cpp
lib/StaticAnalyzer/Core/ExplodedGraph.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp

index 367d3926dc61ad18190fca3da9215ece7dda0cb1..510293a10461024fda6eb9a4f24fd611b0db5c35 100644 (file)
@@ -291,12 +291,9 @@ public:
     return cloneWithState<CallEvent>(NewState);
   }
 
-  /// \brief Returns true if this is a statement that can be considered for
-  /// inlining.
-  ///
-  /// FIXME: This should go away once CallEvents are cheap and easy to
-  /// construct from ExplodedNodes.
-  static bool mayBeInlined(const Stmt *S);
+  /// \brief Returns true if this is a statement is a function or method call
+  /// of some kind.
+  static bool isCallStmt(const Stmt *S);
 
   // Iterator access to formal parameters and their types.
 private:
index d4ee84174e3e423db9869dbf8792887808e08397..1f86945fb342e9793685eed7e5a900c6f7faf806 100644 (file)
@@ -230,10 +230,10 @@ void CallEvent::dump(raw_ostream &Out) const {
 }
 
 
-bool CallEvent::mayBeInlined(const Stmt *S) {
-  // FIXME: Kill this.
+bool CallEvent::isCallStmt(const Stmt *S) {
   return isa<CallExpr>(S) || isa<ObjCMessageExpr>(S)
-                          || isa<CXXConstructExpr>(S);
+                          || isa<CXXConstructExpr>(S)
+                          || isa<CXXNewExpr>(S);
 }
 
 static void addParameterValuesToBindings(const StackFrameContext *CalleeCtx,
index 9145565d3a0d428cfe1927e1b5f262e6589491d0..ae746f6325051b5be5f02973b7e46dd05523fc18 100644 (file)
@@ -115,7 +115,7 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
   // Condition 9.
   const ProgramPoint SuccLoc = succ->getLocation();
   if (const StmtPoint *SP = dyn_cast<StmtPoint>(&SuccLoc))
-    if (CallEvent::mayBeInlined(SP->getStmt()))
+    if (CallEvent::isCallStmt(SP->getStmt()))
       return false;
 
   return true;
index 15379d6b91e9920f39a93062f1a099659fc49e04..6603b6ca5dbe28074ab557aff45c0850b73bbd92 100644 (file)
@@ -240,7 +240,7 @@ static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
     return true;
     
   // Run before processing a call.
-  if (CallEvent::mayBeInlined(S.getStmt()))
+  if (CallEvent::isCallStmt(S.getStmt()))
     return true;
 
   // Is this an expression that is consumed by another expression?  If so,