Skip to content

Commit 77e5c5d

Browse files
committed
Revert "[LEB128] Mark error condition with LLVM_UNLIKELY"
This reverts commit 80fc872.
1 parent 3313c25 commit 77e5c5d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llvm/include/llvm/Support/LEB128.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,15 @@ inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = nullptr,
135135
uint64_t Value = 0;
136136
unsigned Shift = 0;
137137
do {
138-
if (LLVM_UNLIKELY(p == end)) {
138+
if (p == end) {
139139
if (error)
140140
*error = "malformed uleb128, extends past end";
141141
Value = 0;
142142
break;
143143
}
144144
uint64_t Slice = *p & 0x7f;
145-
if (LLVM_UNLIKELY(Shift >= 63) &&
146-
((Shift == 63 && (Slice << Shift >> Shift) != Slice) ||
147-
(Shift > 63 && Slice != 0))) {
145+
if (Shift >= 63 && ((Shift == 63 && (Slice << Shift >> Shift) != Slice) ||
146+
(Shift > 63 && Slice != 0))) {
148147
if (error)
149148
*error = "uleb128 too big for uint64";
150149
Value = 0;
@@ -170,7 +169,7 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
170169
unsigned Shift = 0;
171170
uint8_t Byte;
172171
do {
173-
if (LLVM_UNLIKELY(p == end)) {
172+
if (p == end) {
174173
if (error)
175174
*error = "malformed sleb128, extends past end";
176175
if (n)
@@ -179,9 +178,8 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
179178
}
180179
Byte = *p;
181180
uint64_t Slice = Byte & 0x7f;
182-
if (LLVM_UNLIKELY(Shift >= 63) &&
183-
((Shift == 63 && Slice != 0 && Slice != 0x7f) ||
184-
(Shift > 63 && Slice != (Value < 0 ? 0x7f : 0x00)))) {
181+
if ((Shift >= 63) && ((Shift == 63 && Slice != 0 && Slice != 0x7f) ||
182+
(Shift > 63 && Slice != (Value < 0 ? 0x7f : 0x00)))) {
185183
if (error)
186184
*error = "sleb128 too big for int64";
187185
if (n)

0 commit comments

Comments
 (0)