summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-01-16 00:31:22 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-01-16 00:31:22 +0000
commitdc13453128d5d1d60b3b3583337c91a095fa90e7 (patch)
tree6e3ff34b49a569003f01c59bc4c0f46e7b314748 /clang/lib/CodeGen/CodeGenModule.cpp
parentf0f5e870831fc4ac78c18f6fb786a9bea37e8aa9 (diff)
downloadbcm5719-llvm-dc13453128d5d1d60b3b3583337c91a095fa90e7.tar.gz
bcm5719-llvm-dc13453128d5d1d60b3b3583337c91a095fa90e7.zip
Introduce -fsanitize-stats flag.
This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16175 llvm-svn: 257971
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 41a4a1212ea..5a85de7e234 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -392,6 +392,8 @@ void CodeGenModule::Release() {
if (CoverageMapping)
CoverageMapping->emit();
emitLLVMUsed();
+ if (SanStats)
+ SanStats->finish();
if (CodeGenOpts.Autolink &&
(Context.getLangOpts().Modules || !LinkerOptionsMetadata.empty())) {
@@ -4066,3 +4068,10 @@ void CodeGenModule::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap,
Target.getTargetOpts().Features);
}
}
+
+llvm::SanitizerStatReport &CodeGenModule::getSanStats() {
+ if (!SanStats)
+ SanStats = llvm::make_unique<llvm::SanitizerStatReport>(&getModule());
+
+ return *SanStats;
+}
OpenPOWER on IntegriCloud