summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
index 2c1f6c1d8f9..1d006b09ccb 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -733,13 +733,27 @@ void ExprEngine::conservativeEvalCall(const CallEvent &Call, NodeBuilder &Bldr,
Bldr.generateNode(Call.getProgramPoint(), State, Pred);
}
+static bool isEssentialToInline(const CallEvent &Call) {
+ const Decl *D = Call.getDecl();
+ if (D) {
+ AnalysisDeclContext *AD =
+ Call.getLocationContext()->getAnalysisDeclContext()->
+ getManager()->getContext(D);
+
+ // The auto-synthesized bodies are essential to inline as they are
+ // usually small and commonly used.
+ return AD->isBodyAutosynthesized();
+ }
+ return false;
+}
+
void ExprEngine::defaultEvalCall(NodeBuilder &Bldr, ExplodedNode *Pred,
const CallEvent &CallTemplate) {
// Make sure we have the most recent state attached to the call.
ProgramStateRef State = Pred->getState();
CallEventRef<> Call = CallTemplate.cloneWithState(State);
- if (HowToInline == Inline_None) {
+ if (HowToInline == Inline_None && !isEssentialToInline(CallTemplate)) {
conservativeEvalCall(*Call, Bldr, Pred, State);
return;
}
OpenPOWER on IntegriCloud