[llvm] 89b1184 - [test][DebugInfo][NFC] Rename method for clarity

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 03:30:49 PST 2020


Author: James Henderson
Date: 2020-01-06T11:30:26Z
New Revision: 89b11843254a4a0d7581b8c625fc0b40dfaf0235

URL: https://github.com/llvm/llvm-project/commit/89b11843254a4a0d7581b8c625fc0b40dfaf0235
DIFF: https://github.com/llvm/llvm-project/commit/89b11843254a4a0d7581b8c625fc0b40dfaf0235.diff

LOG: [test][DebugInfo][NFC] Rename method for clarity

The checkGetOrParseLineTableEmitsError function could end up generating
both recoverable and unrecoverable errors, but it is only intended for
handling the latter.

Reviewed by: dblaikie

Differential Revision: https://reviews.llvm.org/D72156

Added: 
    

Modified: 
    llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
index ca78e18a38d8..b38e8dfcaccc 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -110,8 +110,8 @@ struct CommonFixture {
     checkError(ArrayRef<StringRef>{ExpectedMsg}, std::move(Err));
   }
 
-  void checkGetOrParseLineTableEmitsError(StringRef ExpectedMsg,
-                                          uint64_t Offset = 0) {
+  void checkGetOrParseLineTableEmitsFatalError(StringRef ExpectedMsg,
+                                               uint64_t Offset = 0) {
     auto ExpectedLineTable = Line.getOrParseLineTable(
         LineData, Offset, *Context, nullptr, RecordRecoverable);
     EXPECT_FALSE(ExpectedLineTable);
@@ -120,8 +120,8 @@ struct CommonFixture {
     checkError(ExpectedMsg, ExpectedLineTable.takeError());
   }
 
-  void checkGetOrParseLineTableEmitsError(ArrayRef<StringRef> ExpectedMsgs,
-                                          uint64_t Offset = 0) {
+  void checkGetOrParseLineTableEmitsFatalError(ArrayRef<StringRef> ExpectedMsgs,
+                                               uint64_t Offset = 0) {
     auto ExpectedLineTable = Line.getOrParseLineTable(
         LineData, Offset, *Context, nullptr, RecordRecoverable);
     EXPECT_FALSE(ExpectedLineTable);
@@ -207,13 +207,13 @@ TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffset) {
     return;
   generate();
 
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "offset 0x00000000 is not a valid debug line section offset", 0);
   // Repeat to show that an error is reported each time.
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "offset 0x00000000 is not a valid debug line section offset", 0);
   // Show that an error is reported for later offsets too.
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "offset 0x00000001 is not a valid debug line section offset", 1);
 }
 
@@ -226,7 +226,7 @@ TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffsetAfterData) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "offset 0x00000001 is not a valid debug line section offset", 1);
 }
 
@@ -305,7 +305,7 @@ TEST_F(DebugLineBasicFixture, ErrorForReservedLength) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "parsing line table prologue at offset 0x00000000 unsupported reserved "
       "unit length found of value 0xfffffff0");
 }
@@ -320,9 +320,10 @@ TEST_F(DebugLineBasicFixture, ErrorForLowVersion) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError("parsing line table prologue at offset "
-                                     "0x00000000 found unsupported version "
-                                     "0x01");
+  checkGetOrParseLineTableEmitsFatalError(
+      "parsing line table prologue at offset "
+      "0x00000000 found unsupported version "
+      "0x01");
 }
 
 TEST_F(DebugLineBasicFixture, ErrorForInvalidV5IncludeDirTable) {
@@ -353,7 +354,7 @@ TEST_F(DebugLineBasicFixture, ErrorForInvalidV5IncludeDirTable) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       {"parsing line table prologue at 0x00000000 found an invalid directory "
        "or file table description at 0x00000014",
        "failed to parse entry content descriptions because no path was found"});
@@ -375,7 +376,7 @@ TEST_P(DebugLineParameterisedFixture, ErrorForTooLargePrologueLength) {
 
   uint64_t ExpectedEnd =
       Prologue.TotalLength + 1 + Prologue.sizeofTotalLength();
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       (Twine("parsing line table prologue at 0x00000000 should have ended at "
              "0x000000") +
        Twine::utohexstr(ExpectedEnd) + " but it ended at 0x000000" +
@@ -406,7 +407,7 @@ TEST_P(DebugLineParameterisedFixture, ErrorForTooShortPrologueLength) {
       Prologue.TotalLength - 1 + Prologue.sizeofTotalLength();
   if (Version < 5)
     --ExpectedEnd;
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       (Twine("parsing line table prologue at 0x00000000 should have ended at "
              "0x000000") +
        Twine::utohexstr(ExpectedEnd) + " but it ended at 0x000000" +
@@ -432,8 +433,9 @@ TEST_F(DebugLineBasicFixture, ErrorForInvalidExtendedOpcodeLength) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError("unexpected line op length at offset "
-                                     "0x00000030 expected 0x02 found 0x01");
+  checkGetOrParseLineTableEmitsFatalError(
+      "unexpected line op length at offset "
+      "0x00000030 expected 0x02 found 0x01");
 }
 
 TEST_F(DebugLineBasicFixture, ErrorForMismatchedAddressSize) {
@@ -449,7 +451,7 @@ TEST_F(DebugLineBasicFixture, ErrorForMismatchedAddressSize) {
 
   generate();
 
-  checkGetOrParseLineTableEmitsError(
+  checkGetOrParseLineTableEmitsFatalError(
       "mismatching address size at offset 0x00000030 expected 0x08 found 0x04");
 }
 


        


More information about the llvm-commits mailing list