diff options
author | Stuart Hastings <stuart@apple.com> | 2011-05-26 02:44:56 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2011-05-26 02:44:56 +0000 |
commit | aa4e6afc9be330770e0b5d41e79aa26c3115bcca (patch) | |
tree | da54e6dcadc61d248dc1490c4c745276a0c110d3 /lib/CodeGen/CallingConvLower.cpp | |
parent | fcdc9a44e59ff2846c6f929e91c90ee34e6ba5d5 (diff) |
Correctly handle a one-word struct passed byval on x86_64.
rdar://problem/6920088
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CallingConvLower.cpp')
-rw-r--r-- | lib/CodeGen/CallingConvLower.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CallingConvLower.cpp b/lib/CodeGen/CallingConvLower.cpp index bfb6ba1023..d9cadf090f 100644 --- a/lib/CodeGen/CallingConvLower.cpp +++ b/lib/CodeGen/CallingConvLower.cpp @@ -48,8 +48,13 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT, if (MinAlign > (int)Align) Align = MinAlign; TM.getTargetLowering()->HandleByVal(const_cast<CCState*>(this), Size); - unsigned Offset = AllocateStack(Size, Align); - addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); + if (Size) { + unsigned Offset = AllocateStack(Size, Align); + addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); + } else { + addLoc(CCValAssign::getReg(ValNo, ValVT, getFirstByValReg(), LocVT, + LocInfo)); + } } /// MarkAllocated - Mark a register and all of its aliases as allocated. |