@@ -797,27 +797,22 @@ static void addSanitizers(const Triple &TargetTriple,
797797
798798 // SanitizeSkipHotCutoffs: doubles with range [0, 1]
799799 // Opts.cutoffs: ints with range [0, 1000000]
800- std::optional<std::vector<int >> scaledCutoffs =
800+ std::optional<std::vector<int >> ScaledCutoffs =
801801 CodeGenOpts.SanitizeSkipHotCutoffs .getAllScaled (1000000 );
802802
803803 // TODO: remove IsRequested()
804- if (LowerAllowCheckPass::IsRequested () || scaledCutoffs .has_value ()) {
804+ if (LowerAllowCheckPass::IsRequested () || ScaledCutoffs .has_value ()) {
805805 // We want to call it after inline, which is about OptimizerEarlyEPCallback.
806806 PB.registerOptimizerEarlyEPCallback ([&](ModulePassManager &MPM,
807807 OptimizationLevel Level,
808808 ThinOrFullLTOPhase Phase) {
809809 LowerAllowCheckPass::Options Opts;
810810
811- // TODO: after removing IsRequested(), the if case will be unconditional
812- if (scaledCutoffs .has_value ()) {
811+ // TODO: after removing IsRequested(), make this unconditional
812+ if (ScaledCutoffs .has_value ())
813813 // Copy from std::vector<int> to std::vector<unsigned int>
814- Opts.cutoffs = {scaledCutoffs.value ().begin (),
815- scaledCutoffs.value ().end ()};
816- } else {
817- for (unsigned int i = 0 ; i < SanitizerKind::SO_Count; ++i) {
818- Opts.cutoffs .push_back (0 );
819- }
820- }
814+ Opts.cutoffs = {ScaledCutoffs.value ().begin (),
815+ ScaledCutoffs.value ().end ()};
821816
822817 MPM.addPass (createModuleToFunctionPassAdaptor (LowerAllowCheckPass (Opts)));
823818 });
0 commit comments