Skip to content

Commit

Permalink
Rangefy, and replace a switch with ifs. NFC.
Browse files Browse the repository at this point in the history
llvm-svn: 260320
  • Loading branch information
rui314 committed Feb 9, 2016
1 parent 260854b commit d3bd97a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lld/ELF/OutputSections.cpp
Expand Up @@ -943,21 +943,20 @@ uint8_t EHOutputSection<ELFT>::getFdeEncoding(ArrayRef<uint8_t> D) {
// We only care about an 'R' value, but other records may precede an 'R'
// record. Records are not in TLV (type-length-value) format, so we need
// to teach the linker how to skip records for each type.
for (; !Aug.empty(); Aug = Aug.substr(1)) {
switch (Aug[0]) {
case 'z':
skipLeb128(D);
break;
case 'R':
for (char C : Aug) {
if (C == 'R')
return readByte(D);
case 'P':
if (C == 'z') {
skipLeb128(D);
continue;
}
if (C == 'P') {
skipAugP<ELFT>(D);
break;
case 'L':
break;
default:
fatal("unknown .eh_frame augmentation string: " + Aug);
continue;
}
if (C == 'L')
continue;
fatal("unknown .eh_frame augmentation string: " + Aug);
}
return DW_EH_PE_absptr;
}
Expand Down

0 comments on commit d3bd97a

Please sign in to comment.