Skip to content

Commit b340b41

Browse files
committed
remove comment and move initialization
Created using spr 1.3.4
1 parent 94d1be7 commit b340b41

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/ObjectYAML/ELFYAML.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ static bool isInteger(StringRef Val) {
15881588

15891589
void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
15901590
IO &IO, std::unique_ptr<ELFYAML::Chunk> &Section) {
1591-
ELFYAML::ELF_SHT Type;
1591+
ELFYAML::ELF_SHT Type = ELF::SHT_NULL;
15921592
StringRef TypeStr;
15931593
if (IO.outputting()) {
15941594
if (auto *S = dyn_cast<ELFYAML::Section>(Section.get()))
@@ -1599,8 +1599,6 @@ void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
15991599
// When the Type string does not have a "SHT_" prefix, we know it is not a
16001600
// description of a regular ELF output section.
16011601
TypeStr = getStringValue(IO, "Type");
1602-
// To for fallback to `default` in switch below on error.
1603-
Type = ELF::SHT_NULL;
16041602
if (TypeStr.starts_with("SHT_") || isInteger(TypeStr))
16051603
IO.mapRequired("Type", Type);
16061604
}

0 commit comments

Comments
 (0)