This is an archive of the discontinued LLVM Phabricator instance.

LLD/ELF: Allow targets to set e_flags
ClosedPublic

Authored by kzhuravl on Oct 20 2017, 1:19 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

kzhuravl created this revision.Oct 20 2017, 1:19 PM
t-tye added inline comments.Oct 20 2017, 7:18 PM
ELF/Arch/MipsArchTree.cpp
284 ↗(On Diff #119697)

Would it be better to just rename this calcEFlags to match how the other targets are now?

ruiu added inline comments.Oct 22 2017, 5:29 PM
ELF/Arch/MipsArchTree.cpp
284 ↗(On Diff #119697)

Yes, please just rename it.

kzhuravl added inline comments.Oct 23 2017, 12:53 PM
ELF/Arch/MipsArchTree.cpp
284 ↗(On Diff #119697)

Could you elaborate on what needs renaming?

Reasons why I left it as is:

  • Mips class derived from TargetInfo is in anonymous namespace in Mips.cpp, so inaccessible in MipsArchTree.cpp
  • calcMipsEFlags is using few functions (e.g. checkFlags) that are static, so inaccessible in Mips.cpp

I was thinking of merging Mips.cpp and MipsArchTree.cpp into one file, but not sure if it is the right choice (I do not know why it was done this way in the first place).

ruiu accepted this revision.Oct 23 2017, 7:12 PM

LGTM, but please apply clang-format-diff before committing. Thanks!

ELF/Arch/MipsArchTree.cpp
284 ↗(On Diff #119697)

Ah, got it. I wasn't aware that the function is in another file. I'm fine with the current code.

This revision is now accepted and ready to land.Oct 23 2017, 7:12 PM
In D39139#904673, @ruiu wrote:

LGTM, but please apply clang-format-diff before committing. Thanks!

Done, thanks.

This revision was automatically updated to reflect the committed changes.