This is an archive of the discontinued LLVM Phabricator instance.

lld: Add ILP32 support to X86_64TargetInfo
ClosedPublic

Authored by hjl.tools on Jul 12 2016, 4:05 PM.

Details

Summary

As x86-64 psABI supports both LP64 and ILP32, this patch adds <ELFT>
template to X86_64TargetInfo.

Diff Detail

Repository
rL LLVM

Event Timeline

hjl.tools updated this revision to Diff 63746.Jul 12 2016, 4:05 PM
hjl.tools retitled this revision from to lld: Add ILP32 support to X86_64TargetInfo .
hjl.tools updated this object.
hjl.tools added a reviewer: ruiu.
hjl.tools set the repository for this revision to rL LLVM.
hjl.tools added a project: lld.
hjl.tools added a subscriber: llvm-commits.
ruiu accepted this revision.Jul 12 2016, 4:14 PM
ruiu edited edge metadata.

LGTM with a nit.

ELF/Target.cpp
239–246 ↗(On Diff #63746)

This seems a bit too defensive. I'd simply do

if (Config->EKind == ELF32LEKind)
  return new X86_64TargetInfo<ELF32LE>();
return new X86_64TargetInfo<ELF64LE>();
This revision is now accepted and ready to land.Jul 12 2016, 4:14 PM
This revision was automatically updated to reflect the committed changes.
ruiu added a subscriber: ruiu.Jul 12 2016, 4:37 PM

Committed with a minor modification for no-else-after-return policy.