https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/123228
This slightly simplifies the code. >From 010c9738c2182d3e269c305fd97dbb498a5dc717 Mon Sep 17 00:00:00 2001 From: Florian Mayer <fma...@google.com> Date: Thu, 16 Jan 2025 11:23:54 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- clang/lib/CodeGen/CGExpr.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 6e5a21c8f01e78..9a9a8c7f6eae09 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -3607,18 +3607,15 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; - for (int i = 0, n = Checked.size(); i < n; ++i) { - llvm::Value *Check = Checked[i].first; + for (auto &[Check, Ord] : Checked) { // -fsanitize-trap= overrides -fsanitize-recover=. - llvm::Value *&Cond = - CGM.getCodeGenOpts().SanitizeTrap.has(Checked[i].second) - ? TrapCond - : CGM.getCodeGenOpts().SanitizeRecover.has(Checked[i].second) - ? RecoverableCond - : FatalCond; + llvm::Value *&Cond = CGM.getCodeGenOpts().SanitizeTrap.has(Ord) ? TrapCond + : CGM.getCodeGenOpts().SanitizeRecover.has(Ord) + ? RecoverableCond + : FatalCond; Cond = Cond ? Builder.CreateAnd(Cond, Check) : Check; - if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second)) + if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Ord)) NoMerge = true; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits