]> granicus.if.org Git - clang/commitdiff
Add the -mstackrealign option which just communicates the need to
authorEric Christopher <echristo@apple.com>
Mon, 2 May 2011 21:18:22 +0000 (21:18 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 2 May 2011 21:18:22 +0000 (21:18 +0000)
force align the stack to the backend.

Fixes rdar://9289631

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

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

index d243bf989fda7544f97f0fdee3bef0e26d3d916f..dd0984634dad26a7c3f5bec9194deee0f3b5921b 100644 (file)
@@ -178,6 +178,8 @@ def mconstructor_aliases : Flag<"-mconstructor-aliases">,
   HelpText<"Emit complete constructors and destructors as aliases when possible">;
 def mms_bitfields : Flag<"-mms-bitfields">,
   HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">;
+def mstackrealign : Flag<"-mstackrealign">,
+  HelpText<"Force realign the stack at entry to every function.">;
 def O : Joined<"-O">, HelpText<"Optimization level">;
 def Os : Flag<"-Os">, HelpText<"Optimize for size">;
 def Oz : Flag<"-Oz">, HelpText<"Optimize for size, regardless of performance">;
index 38f0c57af73ee116d00fa44599399cc9bff7429c..b587a51a3ba1a8610b9b68c958e2ef5556f62074 100644 (file)
@@ -513,6 +513,7 @@ def mlinker_version_EQ : Joined<"-mlinker-version=">, Flags<[NoForward]>;
 def mllvm : Separate<"-mllvm">;
 def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>;
 def mms_bitfields : Flag<"-mms-bitfields">, Group<m_Group>;
+def mstackrealign : Flag<"-mstackrealign">, Group<m_Group>;
 def mmmx : Flag<"-mmmx">, Group<m_x86_Features_Group>;
 def mno_3dnowa : Flag<"-mno-3dnowa">, Group<m_x86_Features_Group>;
 def mno_3dnow : Flag<"-mno-3dnow">, Group<m_x86_Features_Group>;
index 89cf228d9520c3b3180936825b1076f9e3351823..bf73ca2c3001b0853a0e903a2e435b5e70e6e6f6 100644 (file)
@@ -1546,6 +1546,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(Args.MakeArgString(llvm::Twine(StackProtectorLevel)));
   }
 
+  // Translate -mstackrealign
+  if (Args.hasArg(options::OPT_mstackrealign)) {
+    CmdArgs.push_back("-backend-option");
+    CmdArgs.push_back("-force-align-stack");
+  }
+  
   // Forward -f options with positive and negative forms; we translate
   // these by hand.