Skip to content

Commit 71e1893

Browse files
jrtc27krishna2803
authored andcommitted
[NFC][ELF][Hexagon] Avoid pointless ArrayRef::drop_front
Fixes: b42f96b ("[lld] Add thunks for hexagon (llvm#111217)")
1 parent 1030980 commit 71e1893

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
@@ -2152,9 +2152,8 @@ static int getHexagonPacketOffset(const InputSection &isec,
21522152
if (i == 3 || rel.offset < (i + 1) * 4)
21532153
return i * 4;
21542154
uint32_t instWord = 0;
2155-
const ArrayRef<uint8_t> instWordContents =
2156-
data.drop_front(rel.offset - (i + 1) * 4);
2157-
memcpy(&instWord, instWordContents.data(), sizeof(instWord));
2155+
memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
2156+
sizeof(instWord));
21582157
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
21592158
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
21602159
return i * 4;

0 commit comments

Comments
 (0)