summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSam Elliott <selliott@lowrisc.org>2019-07-01 14:53:56 +0000
committerSam Elliott <selliott@lowrisc.org>2019-07-01 14:53:56 +0000
commit44f7b2cea9a2ae54023740cf1a8c067d6b0e090a (patch)
tree0ac015a601683e45d20e2c119a6efbb4faabd836 /lib
parent07eaf903c98a285febee5b17aef627d869780aea (diff)
downloadclang-44f7b2cea9a2ae54023740cf1a8c067d6b0e090a.tar.gz
[RISCV] Avoid save-restore target feature warning
Summary: LLVM issues a warning if passed unknown target features. Neither I nor @asb noticed this until after https://reviews.llvm.org/D63498 landed. This patch stops passing the (unknown) "save-restore" target feature to the LLVM backend, but continues to emit a warning if a driver asks for `-msave-restore`. The default of assuming `-mno-save-restore` (and emitting no warnings) remains. Reviewers: asb Reviewed By: asb Subscribers: rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, cfe-commits, asb Tags: #clang Differential Revision: https://reviews.llvm.org/D64008 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Driver/ToolChains/Arch/RISCV.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Driver/ToolChains/Arch/RISCV.cpp b/lib/Driver/ToolChains/Arch/RISCV.cpp
index 075c951e82..b6768de4d2 100644
--- a/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -358,14 +358,12 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const ArgList &Args,
else
Features.push_back("-relax");
- // -mno-save-restore is default, unless -msave-restore is specified.
+ // GCC Compatibility: -mno-save-restore is default, unless -msave-restore is
+ // specified...
if (Args.hasFlag(options::OPT_msave_restore, options::OPT_mno_save_restore, false)) {
- Features.push_back("+save-restore");
- // ... but we don't yet support +save-restore, so issue a warning.
+ // ... but we don't support -msave-restore, so issue a warning.
D.Diag(diag::warn_drv_clang_unsupported)
<< Args.getLastArg(options::OPT_msave_restore)->getAsString(Args);
- } else {
- Features.push_back("-save-restore");
}
// Now add any that the user explicitly requested on the command line,