summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2019-02-17 16:05:51 +0000
committerShiva Chen <shiva0217@gmail.com>2019-02-17 16:05:51 +0000
commite3aaeabb6da645219abba218f5dcc38087c0d07e (patch)
treeb00137b8bacdd3d6707cb57b5dd41d9d4efca997 /clang/lib/Driver
parentbee207354271cec26da6c4866b0e80670fdc5082 (diff)
downloadbcm5719-llvm-e3aaeabb6da645219abba218f5dcc38087c0d07e.tar.gz
bcm5719-llvm-e3aaeabb6da645219abba218f5dcc38087c0d07e.zip
[RISCV] Default enable RISCV linker relaxation
Differential Revision: https://reviews.llvm.org/D47127 llvm-svn: 354222
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains/Arch/RISCV.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index e40911f4dbf..b5cee381e1f 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -364,6 +364,18 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const ArgList &Args,
getExtensionFeatures(D, Args, Features, MArch, OtherExts);
}
+ // -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;
+ Features.push_back("-relax");
+ }
+ }
+
+ if (Relax)
+ Features.push_back("+relax");
+
// Now add any that the user explicitly requested on the command line,
// which may override the defaults.
handleTargetFeaturesGroup(Args, Features, options::OPT_m_riscv_Features_Group);
OpenPOWER on IntegriCloud