// TODO: To reduce false negatives here, we should track the container
// allocation site and check if a proper deallocator was set there.
static bool isCFCGAllowingEscape(StringRef FName);
+
+ // Check if this kind of expression can be inlined by the analyzer.
+ static bool canBeInlined(const Stmt *S) {
+ return isa<CallExpr>(S);
+ }
};
}
//===----------------------------------------------------------------------===//
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/ParentMap.h"
// Condition 9.
const ProgramPoint SuccLoc = succ->getLocation();
if (const StmtPoint *SP = dyn_cast<StmtPoint>(&SuccLoc))
- if (isa<CallExpr>(SP->getStmt()))
+ if (CallOrObjCMessage::canBeInlined(SP->getStmt()))
return false;
return true;
return true;
// Run before processing a call.
- if (isa<CallExpr>(S.getStmt()))
+ if (CallOrObjCMessage::canBeInlined(S.getStmt()))
return true;
// Is this an expression that is consumed by another expression? If so,