Provide option for stack alignment override
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49593 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 56bb7ac..463b47f 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -26,6 +26,10 @@
clEnumValN(X86Subtarget::Intel, "intel", " Emit Intel-style assembly"),
clEnumValEnd));
+cl::opt<unsigned>
+StackAlignment("stack-alignment", cl::init(0),
+ cl::desc("Override default stack alignment"));
+
/// True if accessing the GV requires an extra load. For Windows, dllimported
/// symbols are indirect, loading the value at address GV rather then the
@@ -316,4 +320,7 @@
TargetType == isWindows ||
(TargetType == isELF && Is64Bit))
stackAlignment = 16;
+
+ if (StackAlignment)
+ stackAlignment = StackAlignment;
}