[llvm-commits] [llvm] r45939 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Duncan Sands
baldrick at free.fr
Sun Jan 13 13:19:59 PST 2008
Author: baldrick
Date: Sun Jan 13 15:19:59 2008
New Revision: 45939
URL: http://llvm.org/viewvc/llvm-project?rev=45939&view=rev
Log:
Remove the assumption that byval has been applied to
a pointer to a struct.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=45939&r1=45938&r2=45939&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Jan 13 15:19:59 2008
@@ -3916,12 +3916,12 @@
if (F.paramHasAttr(j, ParamAttr::ByVal)) {
Flags |= ISD::ParamFlags::ByVal;
const PointerType *Ty = cast<PointerType>(I->getType());
- const StructType *STy = cast<StructType>(Ty->getElementType());
- unsigned StructAlign =
- Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
- unsigned StructSize = getTargetData()->getABITypeSize(STy);
- Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
- Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);
+ const Type *ElementTy = Ty->getElementType();
+ unsigned FrameAlign =
+ Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
+ unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
+ Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
+ Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs);
}
if (F.paramHasAttr(j, ParamAttr::Nest))
Flags |= ISD::ParamFlags::Nest;
@@ -4046,12 +4046,12 @@
if (Args[i].isByVal) {
Flags |= ISD::ParamFlags::ByVal;
const PointerType *Ty = cast<PointerType>(Args[i].Ty);
- const StructType *STy = cast<StructType>(Ty->getElementType());
- unsigned StructAlign =
- Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
- unsigned StructSize = getTargetData()->getABITypeSize(STy);
- Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
- Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);
+ const Type *ElementTy = Ty->getElementType();
+ unsigned FrameAlign =
+ Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
+ unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
+ Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
+ Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs);
}
if (Args[i].isNest)
Flags |= ISD::ParamFlags::Nest;
More information about the llvm-commits
mailing list