if (LangOpts.Sanitize.has(SanitizerKind::Thread)) {
MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass()));
}
-
- if (LangOpts.Sanitize.has(SanitizerKind::HWAddress)) {
- bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::HWAddress);
- MPM.addPass(createModuleToFunctionPassAdaptor(
- HWAddressSanitizerPass(/*CompileKernel=*/false, Recover)));
- }
-
- if (LangOpts.Sanitize.has(SanitizerKind::KernelHWAddress)) {
- MPM.addPass(createModuleToFunctionPassAdaptor(
- HWAddressSanitizerPass(/*CompileKernel=*/true, /*Recover=*/true)));
- }
}
/// A clean version of `EmitAssembly` that uses the new pass manager.
UseOdrIndicator));
});
}
- if (LangOpts.Sanitize.has(SanitizerKind::HWAddress)) {
- bool Recover =
- CodeGenOpts.SanitizeRecover.has(SanitizerKind::HWAddress);
- PB.registerOptimizerLastEPCallback(
- [Recover](FunctionPassManager &FPM,
- PassBuilder::OptimizationLevel Level) {
- FPM.addPass(HWAddressSanitizerPass(
- /*CompileKernel=*/false, Recover));
- });
- }
- if (LangOpts.Sanitize.has(SanitizerKind::KernelHWAddress)) {
- PB.registerOptimizerLastEPCallback(
- [](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
- FPM.addPass(HWAddressSanitizerPass(
- /*CompileKernel=*/true, /*Recover=*/true));
- });
- }
if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts))
PB.registerPipelineStartEPCallback([Options](ModulePassManager &MPM) {
MPM.addPass(GCOVProfilerPass(*Options));
}
}
+ if (LangOpts.Sanitize.has(SanitizerKind::HWAddress)) {
+ bool Recover = CodeGenOpts.SanitizeRecover.has(SanitizerKind::HWAddress);
+ MPM.addPass(HWAddressSanitizerPass(
+ /*CompileKernel=*/false, Recover));
+ }
+ if (LangOpts.Sanitize.has(SanitizerKind::KernelHWAddress)) {
+ MPM.addPass(HWAddressSanitizerPass(
+ /*CompileKernel=*/true, /*Recover=*/true));
+ }
+
if (CodeGenOpts.OptimizationLevel == 0)
addSanitizersAtO0(MPM, TargetTriple, LangOpts, CodeGenOpts);
}