diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2007-09-07 14:52:14 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2007-09-07 14:52:14 +0000 |
commit | b5c5df48b2dd9773149374d32fb40d12471269d4 (patch) | |
tree | 811e0d3ca7f2f49004c349f4bc2d147ba859ebe2 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 94c46a0e5fae77e8e68c6d1abf442a1327bf1fb6 (diff) | |
download | external_llvm-b5c5df48b2dd9773149374d32fb40d12471269d4.zip external_llvm-b5c5df48b2dd9773149374d32fb40d12471269d4.tar.gz external_llvm-b5c5df48b2dd9773149374d32fb40d12471269d4.tar.bz2 |
Add support for having different alignment for objects on call frames.
The x86-64 ABI states that objects passed on the stack have
8 byte alignment. Implement that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d512ef9..e18beb5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3870,7 +3870,8 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { Flags |= ISD::ParamFlags::ByVal; const PointerType *Ty = cast<PointerType>(I->getType()); const StructType *STy = cast<StructType>(Ty->getElementType()); - unsigned StructAlign = Log2_32(getTargetData()->getABITypeAlignment(STy)); + unsigned StructAlign = + Log2_32(getTargetData()->getCallFrameTypeAlignment(STy)); unsigned StructSize = getTargetData()->getTypeSize(STy); Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs); Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs); @@ -3999,7 +4000,8 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, Flags |= ISD::ParamFlags::ByVal; const PointerType *Ty = cast<PointerType>(Args[i].Ty); const StructType *STy = cast<StructType>(Ty->getElementType()); - unsigned StructAlign = Log2_32(getTargetData()->getABITypeAlignment(STy)); + unsigned StructAlign = + Log2_32(getTargetData()->getCallFrameTypeAlignment(STy)); unsigned StructSize = getTargetData()->getTypeSize(STy); Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs); Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs); |