]> granicus.if.org Git - clang/commit
[RISC-V] Add -msave-restore and -mno-save-restore to clang driver
authorSam Elliott <selliott@lowrisc.org>
Fri, 21 Jun 2019 10:03:31 +0000 (10:03 +0000)
committerSam Elliott <selliott@lowrisc.org>
Fri, 21 Jun 2019 10:03:31 +0000 (10:03 +0000)
commit9c1491fab43f31bc9fd2710d02e5c2c8f93051cb
treefcced8c429e543947bd0a1d9ef5374d8d9447799
parent2bb8e0fe002e8ffaa9ce5fa58034453c94c7e208
[RISC-V] Add -msave-restore and -mno-save-restore to clang driver

Summary:
The GCC RISC-V toolchain accepts `-msave-restore` and `-mno-save-restore`
to control whether libcalls are used for saving and restoring the stack within
prologues and epilogues.

Clang currently errors if someone passes -msave-restore or -mno-save-restore.
This means that people need to change build configurations to use clang. This
patch adds these flags, so that clang invocations can now match gcc.

As the RISC-V backend does not currently have a `save-restore` target feature,
we emit a warning if someone requests `-msave-restore`. LLVM does not error if
we pass the (unimplemented) target features `+save-restore` or `-save-restore`.

Reviewers: asb, luismarques

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, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63498

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364018 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
lib/Driver/ToolChains/Arch/RISCV.cpp
test/Driver/riscv-features.c