[PATCH] D36364: [AArch64] Add support for a MinGW AArch64 target

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 6 04:09:18 PDT 2017


mstorsjo added inline comments.


================
Comment at: lib/Driver/ToolChains/MinGW.cpp:122-131
   if (TC.getArch() == llvm::Triple::x86)
     CmdArgs.push_back("i386pe");
-  if (TC.getArch() == llvm::Triple::x86_64)
+  else if (TC.getArch() == llvm::Triple::x86_64)
     CmdArgs.push_back("i386pep");
-  if (TC.getArch() == llvm::Triple::arm)
+  else if (TC.getArch() == llvm::Triple::arm)
     CmdArgs.push_back("thumb2pe");
+  else if (TC.getArch() == llvm::Triple::aarch64)
----------------
compnerd wrote:
> Can you use a switch here instead?
Sure, I can change that.

What do you think about the `llvm_unreachable` part btw? There's nothing stopping a user from trigger that with e.g. `-target mips-windows-gnu`, and in release builds, such a `default: llvm_unreachable()` case usually ends up as just running one of the existing cases. Should it be changed into a real runtime error that isn't optimized out from release builds?


https://reviews.llvm.org/D36364





More information about the cfe-commits mailing list