summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.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/CodeGenFunction.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/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index e38ff0a39da..e41aa81bdef 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1956,3 +1956,12 @@ void CodeGenFunction::checkTargetFeatures(const CallExpr *E,
<< FD->getDeclName() << TargetDecl->getDeclName() << MissingFeature;
}
}
+
+void CodeGenFunction::EmitSanitizerStatReport(llvm::SanitizerStatKind SSK) {
+ if (!CGM.getCodeGenOpts().SanitizeStats)
+ return;
+
+ llvm::IRBuilder<> IRB(Builder.GetInsertBlock(), Builder.GetInsertPoint());
+ IRB.SetCurrentDebugLocation(Builder.getCurrentDebugLocation());
+ CGM.getSanStats().create(IRB, SSK);
+}
OpenPOWER on IntegriCloud