[PATCH] D22287: lld: Add ILP32 support to X86_64TargetInfo

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 16:21:05 PDT 2016


On Tue, Jul 12, 2016 at 4:14 PM, Rui Ueyama <ruiu at google.com> wrote:
> ruiu accepted this revision.
> ruiu added a comment.
> This revision is now accepted and ready to land.
>
> LGTM with a nit.
>
>
> ================
> Comment at: ELF/Target.cpp:239-246
> @@ -238,3 +238,10 @@
>    case EM_X86_64:
> -    return new X86_64TargetInfo();
> +    switch (Config->EKind) {
> +    case ELF32LEKind:
> +      return new X86_64TargetInfo<ELF32LE>();
> +    case ELF64LEKind:
> +      return new X86_64TargetInfo<ELF64LE>();
> +    default:
> +      fatal("unsupported X86-64 target");
> +    }
>    }
> ----------------
> This seems a bit too defensive. I'd simply do
>
>     if (Config->EKind == ELF32LEKind)
>       return new X86_64TargetInfo<ELF32LE>();
>     return new X86_64TargetInfo<ELF64LE>();
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D22287
>

Here is the updated patch.  Please check it in for me.

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-ILP32-support-to-X86_64TargetInfo.patch
Type: text/x-patch
Size: 9564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160712/cf49cd47/attachment.bin>


More information about the llvm-commits mailing list