[llvm] [NFC] Address review feedback from PR #77004 (PR #77134)

Shubham Sandeep Rastogi via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 12:13:34 PST 2024


https://github.com/rastogishubham created https://github.com/llvm/llvm-project/pull/77134

Accidentally didn't commit the review feedback before merging the PR

>From 610f615b6d5100dee8a918da43cc294dadb9f228 Mon Sep 17 00:00:00 2001
From: Shubham Sandeep Rastogi <srastogi22 at apple.com>
Date: Fri, 5 Jan 2024 12:11:55 -0800
Subject: [PATCH] [NFC] Address review feedback from PR #77004

Accidentally didn't commit the review feedback before merging the PR
---
 llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp         | 4 ++--
 llvm/test/tools/llvm-dwarfdump/verify-no-file.yaml | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 18377815c78b3e..d25b732fdba3f0 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -944,8 +944,8 @@ void DWARFVerifier::verifyDebugLineRows() {
       // row, do not verify the file index, this is a line table of an empty
       // file with an end_sequence, but the DWARF standard sets the file number
       // to 1 by default, otherwise verify file index.
-      if (!(LineTable->Prologue.FileNames.size() == 0 &&
-            LineTable->Rows.size() == 1) &&
+      if ((LineTable->Prologue.FileNames.size() ||
+           LineTable->Rows.size() != 1) &&
           !LineTable->hasFileAtIndex(Row.File)) {
         ++NumDebugLineErrors;
         error() << ".debug_line["
diff --git a/llvm/test/tools/llvm-dwarfdump/verify-no-file.yaml b/llvm/test/tools/llvm-dwarfdump/verify-no-file.yaml
index e43bb880821623..fc25fceef764f9 100644
--- a/llvm/test/tools/llvm-dwarfdump/verify-no-file.yaml
+++ b/llvm/test/tools/llvm-dwarfdump/verify-no-file.yaml
@@ -1,6 +1,5 @@
-# RUN: rm -rf %t && mkdir -p %t
-# RUN: yaml2obj %s -o %t/test.o
-# RUN: llvm-dwarfdump --debug-line --verify %t/test.o 2>&1 | FileCheck %s
+# RUN: yaml2obj %s -o %t.o
+# RUN: llvm-dwarfdump --debug-line --verify %t.o 2>&1 | FileCheck %s
 
 # CHECK-NOT: error: .debug_line[0x{{[0-9a-f]+}}][0] has invalid file index 1 (valid values are [1,0]):
 --- !mach-o



More information about the llvm-commits mailing list