From 78c80fdbdd7a0db3cd5c84f60ddc95e72702fe2e Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sat, 12 Apr 2008 22:12:22 +0000 Subject: [PATCH] Provide option for stack alignment override git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49593 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86Subtarget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 56bb7acdb07..463b47f14ff 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -26,6 +26,10 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset), clEnumValN(X86Subtarget::Intel, "intel", " Emit Intel-style assembly"), clEnumValEnd)); +cl::opt +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 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit) TargetType == isWindows || (TargetType == isELF && Is64Bit)) stackAlignment = 16; + + if (StackAlignment) + stackAlignment = StackAlignment; }