[PATCH] D151233: [DebugInfo] Follow-up to D151001
Alex Langford via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 24 10:20:31 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGad66e9be6a75: [DebugInfo] Follow-up to D151001 (authored by bulbazord).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151233/new/
https://reviews.llvm.org/D151233
Files:
llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp
Index: llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp
===================================================================
--- llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp
+++ llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp
@@ -18,10 +18,10 @@
using namespace llvm;
using namespace dwarf;
-enum Order : bool { InOrder, OutOfOrder };
+enum OrderKind : bool { InOrder, OutOfOrder };
-void WriteAbbreviationDeclarations(raw_ostream &OS, uint32_t FirstCode,
- Order Ord) {
+void writeAbbreviationDeclarations(raw_ostream &OS, uint32_t FirstCode,
+ OrderKind Order) {
encodeULEB128(FirstCode, OS);
encodeULEB128(DW_TAG_compile_unit, OS);
OS << static_cast<uint8_t>(DW_CHILDREN_yes);
@@ -30,7 +30,8 @@
encodeULEB128(0, OS);
encodeULEB128(0, OS);
- uint32_t SecondCode = Ord == Order::InOrder ? FirstCode + 1 : FirstCode - 1;
+ uint32_t SecondCode =
+ Order == OrderKind::InOrder ? FirstCode + 1 : FirstCode - 1;
encodeULEB128(SecondCode, OS);
encodeULEB128(DW_TAG_subprogram, OS);
@@ -46,7 +47,7 @@
raw_svector_ostream OS(RawData);
uint32_t FirstCode = 5;
- WriteAbbreviationDeclarations(OS, FirstCode, InOrder);
+ writeAbbreviationDeclarations(OS, FirstCode, InOrder);
encodeULEB128(0, OS);
uint64_t Offset = 0;
@@ -55,19 +56,19 @@
const bool DataWasExtracted = AbbrevSet.extract(Data, &Offset);
EXPECT_TRUE(DataWasExtracted);
// The Abbreviation Declarations are in order and contiguous, so we want to
- // make sure that FirstAbbrCode was correctly set
+ // make sure that FirstAbbrCode was correctly set.
EXPECT_EQ(AbbrevSet.getFirstAbbrCode(), FirstCode);
const DWARFAbbreviationDeclaration *Abbrev5 =
AbbrevSet.getAbbreviationDeclaration(FirstCode);
- EXPECT_TRUE(Abbrev5);
+ ASSERT_TRUE(Abbrev5);
EXPECT_EQ(Abbrev5->getTag(), DW_TAG_compile_unit);
EXPECT_TRUE(Abbrev5->hasChildren());
EXPECT_EQ(Abbrev5->getNumAttributes(), 1u);
const DWARFAbbreviationDeclaration *Abbrev6 =
AbbrevSet.getAbbreviationDeclaration(FirstCode + 1);
- EXPECT_TRUE(Abbrev6);
+ ASSERT_TRUE(Abbrev6);
EXPECT_EQ(Abbrev6->getTag(), DW_TAG_subprogram);
EXPECT_FALSE(Abbrev6->hasChildren());
EXPECT_EQ(Abbrev6->getNumAttributes(), 1u);
@@ -78,7 +79,7 @@
raw_svector_ostream OS(RawData);
uint32_t FirstCode = 2;
- WriteAbbreviationDeclarations(OS, FirstCode, OutOfOrder);
+ writeAbbreviationDeclarations(OS, FirstCode, OutOfOrder);
encodeULEB128(0, OS);
uint64_t Offset = 0;
@@ -86,19 +87,19 @@
DWARFAbbreviationDeclarationSet AbbrevSet;
const bool DataWasExtracted = AbbrevSet.extract(Data, &Offset);
EXPECT_TRUE(DataWasExtracted);
- // The declarations are out of order, ensure that FirstAbbrCode is UINT32_MAX
+ // The declarations are out of order, ensure that FirstAbbrCode is UINT32_MAX.
EXPECT_EQ(AbbrevSet.getFirstAbbrCode(), UINT32_MAX);
const DWARFAbbreviationDeclaration *Abbrev2 =
AbbrevSet.getAbbreviationDeclaration(FirstCode);
- EXPECT_TRUE(Abbrev2);
+ ASSERT_TRUE(Abbrev2);
EXPECT_EQ(Abbrev2->getTag(), DW_TAG_compile_unit);
EXPECT_TRUE(Abbrev2->hasChildren());
EXPECT_EQ(Abbrev2->getNumAttributes(), 1u);
const DWARFAbbreviationDeclaration *Abbrev1 =
AbbrevSet.getAbbreviationDeclaration(FirstCode - 1);
- EXPECT_TRUE(Abbrev1);
+ ASSERT_TRUE(Abbrev1);
EXPECT_EQ(Abbrev1->getTag(), DW_TAG_subprogram);
EXPECT_FALSE(Abbrev1->hasChildren());
EXPECT_EQ(Abbrev1->getNumAttributes(), 1u);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151233.525245.patch
Type: text/x-patch
Size: 3560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230524/083ee3e9/attachment.bin>
More information about the llvm-commits
mailing list