Page MenuHomePhabricator

[mips] Correct linux dynamic linker for -mnan=2008

Authored by dsanders on Jun 24 2014, 6:19 AM.



The dynamic linker is named when -mnan=2008 is given (or
is the default). It remains for other cases.

This is necessary for MIPS32r6/MIPS64r6 since these ISA's default to -mnan=2008.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 10785.Jun 24 2014, 6:19 AM
dsanders retitled this revision from to [mips] Correct linux dynamic linker for -mnan=2008.
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
atanasyan accepted this revision.Jun 24 2014, 6:31 AM
atanasyan edited edge metadata.

LGTM with a small note.


As to me I would write this code as follow to escape redundant checking of the -mcpu arguments if -mnan option is provided:

if (Arg *NaNArg = Args.getLastArg(options::OPT_mnan_EQ))
  return llvm::StringSwitch<bool>(NaNArg->getValue())
                .Case("2008", true)
                .Case("legacy", false)

// NaN2008 is the default for MIPS32r6/MIPS64r6.
if (Arg *CPUArg = Args.getLastArg(options::OPT_mcpu_EQ))
  return llvm::StringSwitch<bool>(CPUArg->getValue())
                .Cases("mips32r6", "mips64r6", true)

return false;
This revision is now accepted and ready to land.Jun 24 2014, 6:31 AM
dsanders added inline comments.Jun 24 2014, 7:20 AM

Good point. I'll change to that before commit

dsanders updated this revision to Diff 10790.Jun 24 2014, 8:10 AM
dsanders edited edge metadata.

Make the change suggested by Simon and fix a couple silly mistakes caught by
'ninja check-clang'.

dsanders closed this revision.Jun 24 2014, 8:12 AM