diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 18:01:31 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 18:01:31 +0000 | 
| commit | bd5abe19687421cb3ad4dca066732ed0b437531b (patch) | |
| tree | a9b264321873e7d25e69b8671c9f705ebc6d30ee /contrib/llvm/lib/CodeGen/CallingConvLower.cpp | |
| parent | 74d92904a6e0f2d301cdeec3f8af4fbe4a968146 (diff) | |
| parent | 56fe8f14099930935e3870e3e823c322a85c1c89 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/CodeGen/CallingConvLower.cpp')
| -rw-r--r-- | contrib/llvm/lib/CodeGen/CallingConvLower.cpp | 22 | 
1 files changed, 13 insertions, 9 deletions
| diff --git a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp index bfb6ba10234f..14eb0541dc8d 100644 --- a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp @@ -13,6 +13,7 @@  //===----------------------------------------------------------------------===//  #include "llvm/CodeGen/CallingConvLower.h" +#include "llvm/CodeGen/MachineFrameInfo.h"  #include "llvm/Support/Debug.h"  #include "llvm/Support/ErrorHandling.h"  #include "llvm/Support/raw_ostream.h" @@ -22,21 +23,22 @@  #include "llvm/Target/TargetLowering.h"  using namespace llvm; -CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm, -                 SmallVector<CCValAssign, 16> &locs, LLVMContext &C) -  : CallingConv(CC), IsVarArg(isVarArg), TM(tm), +CCState::CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &mf, +                 const TargetMachine &tm, SmallVector<CCValAssign, 16> &locs, +                 LLVMContext &C) +  : CallingConv(CC), IsVarArg(isVarArg), MF(mf), TM(tm),      TRI(*TM.getRegisterInfo()), Locs(locs), Context(C), -    CallOrPrologue(Invalid) { +    CallOrPrologue(Unknown) {    // No stack is used.    StackOffset = 0; -   +    clearFirstByValReg();    UsedRegs.resize((TRI.getNumRegs()+31)/32);  } -// HandleByVal - Allocate a stack slot large enough to pass an argument by -// value. The size and alignment information of the argument is encoded in its -// parameter attribute. +// HandleByVal - Allocate space on the stack large enough to pass an argument +// by value. The size and alignment information of the argument is encoded in +// its parameter attribute.  void CCState::HandleByVal(unsigned ValNo, MVT ValVT,                            MVT LocVT, CCValAssign::LocInfo LocInfo,                            int MinSize, int MinAlign, @@ -47,7 +49,9 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,      Size = MinSize;    if (MinAlign > (int)Align)      Align = MinAlign; -  TM.getTargetLowering()->HandleByVal(const_cast<CCState*>(this), Size); +  if (MF.getFrameInfo()->getMaxAlignment() < Align) +    MF.getFrameInfo()->setMaxAlignment(Align); +  TM.getTargetLowering()->HandleByVal(this, Size);    unsigned Offset = AllocateStack(Size, Align);    addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));  } | 
