summaryrefslogtreecommitdiffstats
path: root/clang
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
commit504e23600357326df62516b0f61598185f623e59 (patch)
tree9e844204b540f2c0173766a65b4ae69e7377a9a9 /clang
parentdfc4bff19bd5392bb459b51d2b61e1bb72f11aed (diff)
downloadbcm5719-llvm-504e23600357326df62516b0f61598185f623e59.tar.gz
bcm5719-llvm-504e23600357326df62516b0f61598185f623e59.zip
[Analyzer] Log when auto-synthesized body is used.
Differential Revision: https://reviews.llvm.org/D37910 llvm-svn: 313944
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 8e2de7d300b..f0a817616db 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud