2006-08-16 16:43:33 +02:00
|
|
|
//===-- ARMTargetFrameInfo.h - Define TargetFrameInfo for ARM ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 21:36:04 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
2006-08-16 16:43:33 +02:00
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef ARM_FRAMEINFO_H
|
|
|
|
#define ARM_FRAMEINFO_H
|
|
|
|
|
|
|
|
#include "ARM.h"
|
2007-01-19 08:51:42 +01:00
|
|
|
#include "ARMSubtarget.h"
|
2009-07-09 08:49:09 +02:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2006-08-16 16:43:33 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2007-01-19 08:51:42 +01:00
|
|
|
class ARMFrameInfo : public TargetFrameInfo {
|
2006-08-16 16:43:33 +02:00
|
|
|
public:
|
2007-07-30 16:51:59 +02:00
|
|
|
explicit ARMFrameInfo(const ARMSubtarget &ST)
|
pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned. For the older ARM APCS ABI, the stack
alignment is just always 4 bytes. For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.
After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo. This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4. (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.
llvm-svn: 82767
2009-09-25 16:41:49 +02:00
|
|
|
: TargetFrameInfo(StackGrowsDown, ST.getStackAlignment(), 0, 4) {
|
2006-08-16 16:43:33 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|