[PATCH] D44888: [RISCV] Default enable linker relaxation and add -mno-relax flag to disable it

Ana Pazos via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 11:08:41 PDT 2018


apazos added inline comments.


================
Comment at: include/clang/Driver/Options.td:1874
 
+def mno_relax : Flag<["-"], "mno-relax">,
+    Group<m_riscv_Features_Group>;
----------------
I think we should define both -mrelax and -mno-relax flags


================
Comment at: lib/Driver/ToolChains/Arch/RISCV.cpp:55
   }
+  if (Args.getLastArg(options::OPT_mno_relax)) {
+    // Not passing relax.
----------------
If we add both mrelax and mno-relax flags, we need to update this logic...

// -mrelax is default, unless -mno-relax is specified.
bool Relax = true;
if (auto *A = Args.getLastArg(options::OPT_mrelax, options::OPT_mno_relax))
  if(A->getOption().matches(options::OPT_mno_relax))
    Relax = false;
if (Relax)
 Features.push_back("+relax");




Repository:
  rC Clang

https://reviews.llvm.org/D44888





More information about the cfe-commits mailing list