Skip to content

Commit 74a0c1e

Browse files
jrtc27tru
authored andcommitted
[NFC][ELF][Hexagon] Avoid pointless ArrayRef::drop_front
Fixes: b42f96b ("[lld] Add thunks for hexagon (llvm#111217)") (cherry picked from commit de15d36)
1 parent 489d36c commit 74a0c1e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lld/ELF/Relocations.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,9 +2154,8 @@ static int getHexagonPacketOffset(const InputSection &isec,
21542154
if (i == 3 || rel.offset < (i + 1) * 4)
21552155
return i * 4;
21562156
uint32_t instWord = 0;
2157-
const ArrayRef<uint8_t> instWordContents =
2158-
data.drop_front(rel.offset - (i + 1) * 4);
2159-
memcpy(&instWord, instWordContents.data(), sizeof(instWord));
2157+
memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
2158+
sizeof(instWord));
21602159
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
21612160
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
21622161
return i * 4;

0 commit comments

Comments
 (0)