[clang] [llvm] [NFC][BoundsChecking] Address #122576 review comments (PR #122773)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 11:31:40 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/122773.diff


2 Files Affected:

- (modified) clang/lib/CodeGen/BackendUtil.cpp (+2-1) 
- (modified) llvm/lib/Passes/PassBuilder.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 79e6bf3d24dffb..3951ad01497cca 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1032,7 +1032,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
           static_assert(SanitizerKind::SO_LocalBounds <=
                             std::numeric_limits<
                                 decltype(Options.GuardKind)::value_type>::max(),
-                        "Update type of llvm.allow.ubsan.check.");
+                        "Update type of llvm.allow.ubsan.check to represent "
+                        "SanitizerKind::SO_LocalBounds.");
           Options.GuardKind = SanitizerKind::SO_LocalBounds;
         }
         Options.Merge =
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index f923d5aabe0a0e..a0bfcef6ce01a8 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1318,7 +1318,7 @@ parseBoundsCheckingOptions(StringRef Params) {
       StringRef ParamEQ;
       StringRef Val;
       std::tie(ParamEQ, Val) = ParamName.split('=');
-      int8_t Id = 0;
+      int8_t Id;
       if (ParamEQ == "guard" && !Val.getAsInteger(0, Id)) {
         Options.GuardKind = Id;
       } else {

``````````

</details>


https://github.com/llvm/llvm-project/pull/122773


More information about the llvm-commits mailing list