[PATCH] D13100: [mips] Separated mips specific -Wa options, so that they are not checked on other platforms.

Daniel Sanders via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 03:22:29 PDT 2015


dsanders added subscribers: rengolin, joerg.
dsanders added a comment.

+Renato and Joerg

I was going to say I think it's ok and the optimizer should be smart enough to factor out the common IsMips check but I've just realized there may be a better way. The current code is using an else after an (implicit) continue. If we made that continue explicit, we could make this code a bit neater and have a place to add target specific options.

I'm thinking something like:

  for (...) {
    ...
  
    auto Arch = C.getDefaultToolChain().getArch();
  
    if (C.getDefaultToolChain().getArch() == llvm::Triple::mips ||
        C.getDefaultToolChain().getArch() == llvm::Triple::mipsel ||
        C.getDefaultToolChain().getArch() == llvm::Triple::mips64 ||
        C.getDefaultToolChain().getArch() == llvm::Triple::mips64el)
      if (mips::CollectArgsForIntegratedAssembler(...)
        continue;
  
    if (Value == "-force_cpusubtype_ALL")
      continue;
  
    ...
  
    D.Diag(diag::err_drv_unsupported_option_argument)
        << A->getOption().getName() << Value;
  }

Thoughts?


http://reviews.llvm.org/D13100





More information about the cfe-commits mailing list