diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-04-23 18:18:10 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-04-23 18:18:10 +0000 |
| commit | cb195f511d409817f92f13efc206edfb83020cba (patch) | |
| tree | b58e6a2991a2a3a1fbdd96feff234fab4745e115 /llvm/lib | |
| parent | 9328fbc4c7c241b3d3df19f7fec071a90ca9d19a (diff) | |
| download | bcm5719-llvm-cb195f511d409817f92f13efc206edfb83020cba.tar.gz bcm5719-llvm-cb195f511d409817f92f13efc206edfb83020cba.zip | |
Make stack alignment options global for all targets
llvm-svn: 50157
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 5 |
3 files changed, 15 insertions, 9 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index c252368b1a3..4b3371d92a2 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -36,6 +36,8 @@ namespace llvm { CodeModel::Model CMModel; bool PerformTailCallOpt; bool OptimizeForSize; + bool RealignStack; + unsigned StackAlignment; } namespace { cl::opt<bool, true> PrintCode("print-machineinstrs", @@ -135,6 +137,18 @@ namespace { cl::desc("Optimize for size."), cl::location(OptimizeForSize), cl::init(false)); + + cl::opt<bool, true> + EnableRealignStack("realign-stack", + cl::desc("Realign stack if needed"), + cl::location(RealignStack), + cl::init(true)); + + cl::opt<unsigned, true> + OverrideStackAlignment("stack-alignment", + cl::desc("Override default stack alignment"), + cl::location(StackAlignment), + cl::init(0)); } //--------------------------------------------------------------------------- diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index f923aef60d1..563093bdec9 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -29,7 +29,6 @@ #include "llvm/CodeGen/MachineLocation.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" @@ -39,10 +38,6 @@ #include "llvm/ADT/STLExtras.h" using namespace llvm; -static cl::opt<bool> -RealignStack("realign-stack", cl::init(true), - cl::desc("Realign stack if needed")); - X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm, const TargetInstrInfo &tii) : X86GenRegisterInfo(X86::ADJCALLSTACKDOWN, X86::ADJCALLSTACKUP), diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index 71b5cb31f57..e0f350c5a1c 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" using namespace llvm; cl::opt<X86Subtarget::AsmWriterFlavorTy> @@ -26,10 +27,6 @@ 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 |

