Hello, In patch [1] the llvm flag arm-reserve-r9 was made available for all ARM targets. This patch adds the corresponding gcc flag to clang in the newly created ARM specific group.
Regards, Jeroen [1] http://llvm.org/viewvc/llvm-project?view=revision&revision=188485
commit dd65428717111eabbaf78101fa8eed4cfcdb8a8f Author: Jeroen Hofstee <[email protected]> Date: Sun Jun 23 12:35:41 2013 +0200 Add the -ffixed-r9 flag for ARM. This patch adds the -ffixed-r9 flag to clang to instruct llvm to globally preserve the contents of r9. The flag is added to the newly created ARM specific group. While at it, also place marm / mno-thumb in that group. diff --git include/clang/Driver/Options.td include/clang/Driver/Options.td index c72622d..4594139 100644 --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -72,6 +72,7 @@ def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>; def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>; def m_x86_Features_Group : OptionGroup<"<m x86 features group>">, Group<m_Group>; def m_hexagon_Features_Group : OptionGroup<"<m hexagon features group>">, Group<m_Group>; +def m_arm_Features_Group : OptionGroup<"<m arm features group>">, Group<m_Group>; def opencl_Group : OptionGroup<"<opencl group>">; def u_Group : OptionGroup<"<u group>">; def mips_CPUs_Group : OptionGroup<"<MIPS CPU aliases group>">, @@ -982,8 +983,10 @@ def mno_rtm : Flag<["-"], "mno-rtm">, Group<m_x86_Features_Group>; def mno_prfchw : Flag<["-"], "mno-prfchw">, Group<m_x86_Features_Group>; def mno_rdseed : Flag<["-"], "mno-rdseed">, Group<m_x86_Features_Group>; -def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_Group>; +def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>; def marm : Flag<["-"], "marm">, Alias<mno_thumb>; +def ffixed_r9 : Flag<["-"], "ffixed-r9">, Group<m_arm_Features_Group>, + HelpText<"Reserve the r9 register (ARM only)">; def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group<m_Group>; def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>; diff --git lib/Driver/Tools.cpp lib/Driver/Tools.cpp index 9768352..3c8300e 100644 --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -847,6 +847,14 @@ void Clang::AddARMTargetArgs(const ArgList &Args, options::OPT_mno_implicit_float, true)) CmdArgs.push_back("-no-implicit-float"); + + // llvm does not support reserving registers in general. There is support + // for reserving r9 on ARM though (defined as a platform-specific register + // in ARM EABI). + if (Args.hasArg(options::OPT_ffixed_r9)) { + CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-arm-reserve-r9"); + } } // Translate MIPS CPU name alias option to CPU name.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
