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 | 276f231c2f254c02b19a019346379c602ffbf3fa (patch) | |
tree | 3887d32428e3d5544123c5d0d1fc1a084427fab3 /llvm/lib/CodeGen/CallingConvLower.cpp | |
parent | d051b871609d8a071c2421f2d4168e3725ba2fcb (diff) | |
download | bcm5719-llvm-276f231c2f254c02b19a019346379c602ffbf3fa.tar.gz bcm5719-llvm-276f231c2f254c02b19a019346379c602ffbf3fa.zip |
Correctly handle a one-word struct passed byval on x86_64.
rdar://problem/6920088
llvm-svn: 132105
Diffstat (limited to 'llvm/lib/CodeGen/CallingConvLower.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CallingConvLower.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/llvm/lib/CodeGen/CallingConvLower.cpp index bfb6ba10234..d9cadf090f5 100644 --- a/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/llvm/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. |