]> granicus.if.org Git - clang/commitdiff
Adds ARM backend options: -mrestrict-it and -mno-restrict-it
authorWeiming Zhao <weimingz@codeaurora.org>
Wed, 13 Nov 2013 18:31:23 +0000 (18:31 +0000)
committerWeiming Zhao <weimingz@codeaurora.org>
Wed, 13 Nov 2013 18:31:23 +0000 (18:31 +0000)
To support the generation of IT block in Thumbv7 way or
Thumbv8 way

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194593 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/Tools.cpp

index e03bc11f654f2e44c11a83d463511a800ac61fda..614c1dfc5bafa9fc3fbd64a0c7a14989bb40c436 100644 (file)
@@ -1029,6 +1029,10 @@ def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group<m_arm_Feat
 def mstrict_align : Flag<["-"], "mstrict-align">, Alias<mno_unaligned_access>, Flags<[CC1Option,HelpHidden]>,
   HelpText<"Force all memory accesses to be aligned (ARM only, same as mno-unaligned-access)">;
 def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>;
+def mrestrict_it: Flag<["-"], "mrestrict-it">, Group<m_arm_Features_Group>,
+  HelpText<"Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.">;
+def mno_restrict_it: Flag<["-"], "mno-restrict-it">, Group<m_arm_Features_Group>,
+  HelpText<"Allow generation of deprecated IT blocks for ARMv8. It is off by default for ARMv8 Thumb mode">;
 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)">;
index a4e4672ab97aec9aaaa442788b67273db1d10f1c..eed06890491c903fd9124a082fc14381ad66d3b4 100644 (file)
@@ -3072,6 +3072,17 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     }
   }
 
+  if (Arg *A = Args.getLastArg(options::OPT_mrestrict_it,
+                               options::OPT_mno_restrict_it)) {
+    if (A->getOption().matches(options::OPT_mrestrict_it)) {
+      CmdArgs.push_back("-backend-option");
+      CmdArgs.push_back("-arm-restrict-it");
+    } else {
+      CmdArgs.push_back("-backend-option");
+      CmdArgs.push_back("-arm-no-restrict-it");
+    }
+  }
+
   // Forward -f options with positive and negative forms; we translate
   // these by hand.
   if (Arg *A = Args.getLastArg(options::OPT_fprofile_sample_use_EQ)) {