aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-04-12 22:12:22 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-04-12 22:12:22 +0000
commit78c80fdbdd7a0db3cd5c84f60ddc95e72702fe2e (patch)
tree514df7ef40b459c9c9090859e5a870a278cec3c0 /lib
parent4b5324ad2cbf774c9c6ed02ea0fcc864f2f5f885 (diff)
downloadexternal_llvm-78c80fdbdd7a0db3cd5c84f60ddc95e72702fe2e.zip
external_llvm-78c80fdbdd7a0db3cd5c84f60ddc95e72702fe2e.tar.gz
external_llvm-78c80fdbdd7a0db3cd5c84f60ddc95e72702fe2e.tar.bz2
Provide option for stack alignment override
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp7
1 files changed, 7 insertions, 0 deletions
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 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset),
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 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
TargetType == isWindows ||
(TargetType == isELF && Is64Bit))
stackAlignment = 16;
+
+ if (StackAlignment)
+ stackAlignment = StackAlignment;
}