summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2017-09-22 00:37:12 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2017-09-22 00:37:12 +0000
commit0702d2e7fe5998912a9979391f64ef6bdd540f00 (patch)
tree4e70ee50e75d36dd891b9c10b3bb6cd09c381efc /lib/StaticAnalyzer
parent0b5ac08821c0efb80531b9bcfdae8c2204e75ff9 (diff)
downloadclang-0702d2e7fe5998912a9979391f64ef6bdd540f00.tar.gz
[Analyzer] Log when auto-synthesized body is used.
Differential Revision: https://reviews.llvm.org/D37910 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313944 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer')
-rw-r--r--lib/StaticAnalyzer/Core/CallEvent.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/CallEvent.cpp b/lib/StaticAnalyzer/Core/CallEvent.cpp
index 8e2de7d300..f0a817616d 100644
--- a/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -21,6 +21,9 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Debug.h"
+
+#define DEBUG_TYPE "static-analyzer-call-event"
using namespace clang;
using namespace ento;
@@ -343,7 +346,6 @@ ArrayRef<ParmVarDecl*> AnyFunctionCall::parameters() const {
return D->parameters();
}
-
RuntimeDefinition AnyFunctionCall::getRuntimeDefinition() const {
const FunctionDecl *FD = getDecl();
// Note that the AnalysisDeclContext will have the FunctionDecl with
@@ -352,8 +354,17 @@ RuntimeDefinition AnyFunctionCall::getRuntimeDefinition() const {
AnalysisDeclContext *AD =
getLocationContext()->getAnalysisDeclContext()->
getManager()->getContext(FD);
- if (AD->getBody())
- return RuntimeDefinition(AD->getDecl());
+ bool IsAutosynthesized;
+ Stmt* Body = AD->getBody(IsAutosynthesized);
+ DEBUG({
+ if (IsAutosynthesized)
+ llvm::dbgs() << "Using autosynthesized body for " << FD->getName()
+ << "\n";
+ });
+ if (Body) {
+ const Decl* Decl = AD->getDecl();
+ return RuntimeDefinition(Decl);
+ }
}
return RuntimeDefinition();