summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-02-09 23:11:21 +0000
committerRui Ueyama <ruiu@google.com>2016-02-09 23:11:21 +0000
commitd3bd97a97d8aa1eea6153b6bf39bc5a10ee0a981 (patch)
treeee7daf2333fc8bf356e921cf5f1fd69bce369b12
parent260854bfaf8053cf3663ec0cd5c642e18f1168aa (diff)
downloadbcm5719-llvm-d3bd97a97d8aa1eea6153b6bf39bc5a10ee0a981.tar.gz
bcm5719-llvm-d3bd97a97d8aa1eea6153b6bf39bc5a10ee0a981.zip
Rangefy, and replace a switch with `if`s. NFC.
llvm-svn: 260320
-rw-r--r--lld/ELF/OutputSections.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 936c00e90af..92e6c9ba1f5 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -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;
}
OpenPOWER on IntegriCloud