[llvm] [NFC] DWARFVerifier: use C-style array instead of brace-enclosed init list (PR #167328)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 07:40:04 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Andrei Golubev (andrey-golubev)

<details>
<summary>Changes</summary>

Historically, MSVC would issue a warning seeing a brace-enclosed initializer list variable being used as a range. A quick fix is to use a C-style array instead which is more or less an equivalent form.

Unfortunately, a lot of time has passed since this patch was originally added to our downstream. Thus, the original warning is long lost. The patch is trivial and harmless enough to be applied nonetheless.

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


1 Files Affected:

- (modified) llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp (+2-2) 


``````````diff
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 693454e249945..440ad4f1268c7 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -1523,8 +1523,8 @@ void DWARFVerifier::verifyNameIndexAttribute(
   }
 
   if (AttrEnc.Index == dwarf::DW_IDX_parent) {
-    constexpr static auto AllowedForms = {dwarf::Form::DW_FORM_flag_present,
-                                          dwarf::Form::DW_FORM_ref4};
+    constexpr static dwarf::Form AllowedForms[] = {
+        dwarf::Form::DW_FORM_flag_present, dwarf::Form::DW_FORM_ref4};
     if (!is_contained(AllowedForms, AttrEnc.Form)) {
       ErrorCategory.Report("Unexpected NameIndex Abbreviation", [&]() {
         error() << formatv(

``````````

</details>


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


More information about the llvm-commits mailing list