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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 16:14:13 PDT 2016


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





More information about the llvm-commits mailing list