From dc13453128d5d1d60b3b3583337c91a095fa90e7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 16 Jan 2016 00:31:22 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') 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 &FeatureMap, Target.getTargetOpts().Features); } } + +llvm::SanitizerStatReport &CodeGenModule::getSanStats() { + if (!SanStats) + SanStats = llvm::make_unique(&getModule()); + + return *SanStats; +} -- cgit v1.2.3