diff options
author | dim <dim@FreeBSD.org> | 2015-01-26 21:19:24 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-26 21:19:24 +0000 |
commit | 52823954cb9d9d77e7956603c9e078beff92dabe (patch) | |
tree | 2309e16a6e6404cd6734b655851dc94927a5df0d | |
parent | bb27da195ab212045bbaa5c453f4098eec853128 (diff) | |
download | FreeBSD-src-52823954cb9d9d77e7956603c9e078beff92dabe.zip FreeBSD-src-52823954cb9d9d77e7956603c9e078beff92dabe.tar.gz |
Pull in r227062 from upstream clang trunk (by Renato Golin):
Allows Clang to use LLVM's fixes-x18 option
This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.
This uses llvm r226664 to allow this register to be reserved.
Patch by Andrew Turner.
Requested by: andrew
-rw-r--r-- | contrib/llvm/tools/clang/include/clang/Driver/Options.td | 3 | ||||
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/Tools.cpp | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/Options.td b/contrib/llvm/tools/clang/include/clang/Driver/Options.td index a48b7ad..faef3b6 100644 --- a/contrib/llvm/tools/clang/include/clang/Driver/Options.td +++ b/contrib/llvm/tools/clang/include/clang/Driver/Options.td @@ -1141,6 +1141,9 @@ def mno_long_calls : Flag<["-"], "mno-long-calls">, Group<m_arm_Features_Group>, def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_aarch64_Features_Group>, HelpText<"Generate code which only uses the general purpose registers (AArch64 only)">; +def ffixed_x18 : Flag<["-"], "ffixed-x18">, Group<m_aarch64_Features_Group>, + HelpText<"Reserve the x18 register (AArch64 only)">; + def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>; def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>; def mfprnd : Flag<["-"], "mfprnd">, Group<m_ppc_Features_Group>; diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp index f33fb32..5acffb7 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -887,6 +887,11 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-mno-global-merge"); } + + if (Args.hasArg(options::OPT_ffixed_x18)) { + CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-aarch64-reserve-x18"); + } } // Get CPU and ABI names. They are not independent |