diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-01-24 00:22:01 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-24 00:22:01 +0000 |
commit | 9b5992a45d2aaba843f4e4ba7a09a487dab1b95e (patch) | |
tree | 5e9d439035ccdf75d7704dea19e0c87fb28dd13c | |
parent | 5a67b819a91592a2e433c2db36481dd7d6ee7bf6 (diff) | |
download | external_llvm-9b5992a45d2aaba843f4e4ba7a09a487dab1b95e.zip external_llvm-9b5992a45d2aaba843f4e4ba7a09a487dab1b95e.tar.gz external_llvm-9b5992a45d2aaba843f4e4ba7a09a487dab1b95e.tar.bz2 |
Forgot these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46292 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e1b5ed1..93de4f0 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3917,8 +3917,7 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { Flags |= ISD::ParamFlags::ByVal; const PointerType *Ty = cast<PointerType>(I->getType()); const Type *ElementTy = Ty->getElementType(); - unsigned FrameAlign = - Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy)); + unsigned FrameAlign = Log2_32(getByValTypeAlignment(ElementTy)); unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs); Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs); @@ -4047,8 +4046,7 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, Flags |= ISD::ParamFlags::ByVal; const PointerType *Ty = cast<PointerType>(Args[i].Ty); const Type *ElementTy = Ty->getElementType(); - unsigned FrameAlign = - Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy)); + unsigned FrameAlign = Log2_32(getByValTypeAlignment(ElementTy)); unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs); Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs); diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 6fb2702..3ccfcfa 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -414,6 +414,12 @@ unsigned TargetLowering::getVectorTypeBreakdown(MVT::ValueType VT, return 1; } +/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate +/// function arguments in the caller parameter area. +unsigned TargetLowering::getByValTypeAlignment(const Type *Ty) const { + return Log2_32(TD->getCallFrameTypeAlignment(Ty)); +} + SDOperand TargetLowering::getPICJumpTableRelocBase(SDOperand Table, SelectionDAG &DAG) const { if (usesGlobalOffsetTable()) |