Add support for the 'alignstack' attribute to the x86 backend. Fixes PR5254.
[oota-llvm.git] / lib / CodeGen / MachineFunction.cpp
index f141c567708798cc63da5d19da469b94b2a1c383..4377d5bd71acfc8dc3f182a919519e5eaf55d2f3 100644 (file)
@@ -95,6 +95,9 @@ MachineFunction::MachineFunction(Function *F, const TargetMachine &TM,
   MFInfo = 0;
   FrameInfo = new (Allocator.Allocate<MachineFrameInfo>())
                   MachineFrameInfo(*TM.getFrameInfo());
+  if (Fn->hasFnAttr(Attribute::StackAlignment))
+    FrameInfo->setMaxAlignment(Attribute::getStackAlignmentFromAttrs(
+        Fn->getAttributes().getFnAttributes()));
   ConstantPool = new (Allocator.Allocate<MachineConstantPool>())
                      MachineConstantPool(TM.getTargetData());
   Alignment = TM.getTargetLowering()->getFunctionAlignment(F);