This is an archive of the discontinued LLVM Phabricator instance.

[PPC64] Add helpers for read/writing an instruction while relocating a half16 type. [NFC]
ClosedPublic

Authored by sfertile on Sep 14 2018, 12:02 PM.

Details

Summary

There are a growing number of places when we either want to read or write an instruction when handling a half16 relocation type. On big-endian the buffer pointer is pointing into the middle of the word we want and on little-endian it is pointing to the start of the word. These 2 helpers are to simplify reading and writing in these contexts

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sfertile created this revision.Sep 14 2018, 12:02 PM
MaskRay added inline comments.Sep 14 2018, 12:15 PM
ELF/Arch/PPC64.cpp
124

uint8_t* Loc -> uint8_t *Loc

129

uint8_t* Loc -> uint8_t *Loc

Looks better!

ruiu accepted this revision.Sep 14 2018, 2:25 PM

LGTM

ELF/Arch/PPC64.cpp
125

I believe you can drop U.

InstrStart is perhaps a bit too long variable name for something whose scope is just two lines. I'd name just L.

130

Ditto.

Drop const because it's obviously a constant.

221

Drop U.

This revision is now accepted and ready to land.Sep 14 2018, 2:25 PM
MaskRay accepted this revision.Sep 14 2018, 2:50 PM
This revision was automatically updated to reflect the committed changes.