summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2014-08-14 21:40:15 +0000
committerDeLesley Hutchins <delesley@google.com>2014-08-14 21:40:15 +0000
commiteb0ea5f40a48c488cb8973490c41713eb202904d (patch)
tree67838dbd25128f56a18fd62e336648eb50caad14 /clang/lib/Analysis
parent61c386126ba1b06ceb8513e9b7f872482c0ff62f (diff)
downloadbcm5719-llvm-eb0ea5f40a48c488cb8973490c41713eb202904d.tar.gz
bcm5719-llvm-eb0ea5f40a48c488cb8973490c41713eb202904d.zip
Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpful when compiling statistics on thread safety warnings.
llvm-svn: 215677
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/ThreadSafety.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp
index c49e6e7049b..469e79be724 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -1810,6 +1810,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
CFG *CFGraph = walker.getGraph();
const NamedDecl *D = walker.getDecl();
+ const FunctionDecl *CurrentFunction = dyn_cast<FunctionDecl>(D);
CurrentMethod = dyn_cast<CXXMethodDecl>(D);
if (D->hasAttr<NoThreadSafetyAnalysisAttr>())
@@ -1824,6 +1825,8 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
if (isa<CXXDestructorDecl>(D))
return; // Don't check inside destructors.
+ Handler.enterFunction(CurrentFunction);
+
BlockInfo.resize(CFGraph->getNumBlockIDs(),
CFGBlockInfo::getEmptyBlockInfo(LocalVarMap));
@@ -2079,6 +2082,8 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
LEK_LockedAtEndOfFunction,
LEK_NotLockedAtEndOfFunction,
false);
+
+ Handler.leaveFunction(CurrentFunction);
}
OpenPOWER on IntegriCloud