summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-04-24 17:37:26 +0000
committerKen Dyck <kd@kendyck.com>2011-04-24 17:37:26 +0000
commitbb2c24008fc1b7d5888511262ccd08d7822829c2 (patch)
tree0ffa3ee407251dc3a7f6e65f43b4a746cbeb5169 /clang
parent239a3357afef3a35c01e4c76b03ddda086eccfc6 (diff)
downloadbcm5719-llvm-bb2c24008fc1b7d5888511262ccd08d7822829c2.tar.gz
bcm5719-llvm-bb2c24008fc1b7d5888511262ccd08d7822829c2.zip
Convert size and alignment variables to CharUnits in EmitAggregateCopy(). No
change in functionality intended. llvm-svn: 130113
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 5c2dc7f5115..53bc58b69c8 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -893,7 +893,8 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
// safely handle this, we can add a target hook.
// Get size and alignment info for this aggregate.
- std::pair<uint64_t, unsigned> TypeInfo = getContext().getTypeInfo(Ty);
+ std::pair<CharUnits, CharUnits> TypeInfo =
+ getContext().getTypeInfoInChars(Ty);
// FIXME: Handle variable sized types.
@@ -923,9 +924,9 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
if (const RecordType *RecordTy = Ty->getAs<RecordType>()) {
RecordDecl *Record = RecordTy->getDecl();
if (Record->hasObjectMember()) {
- unsigned long size = TypeInfo.first/8;
+ CharUnits size = TypeInfo.first;
const llvm::Type *SizeTy = ConvertType(getContext().getSizeType());
- llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size);
+ llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size.getQuantity());
CGM.getObjCRuntime().EmitGCMemmoveCollectable(*this, DestPtr, SrcPtr,
SizeVal);
return;
@@ -934,9 +935,10 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
QualType BaseType = getContext().getBaseElementType(Ty);
if (const RecordType *RecordTy = BaseType->getAs<RecordType>()) {
if (RecordTy->getDecl()->hasObjectMember()) {
- unsigned long size = TypeInfo.first/8;
+ CharUnits size = TypeInfo.first;
const llvm::Type *SizeTy = ConvertType(getContext().getSizeType());
- llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size);
+ llvm::Value *SizeVal =
+ llvm::ConstantInt::get(SizeTy, size.getQuantity());
CGM.getObjCRuntime().EmitGCMemmoveCollectable(*this, DestPtr, SrcPtr,
SizeVal);
return;
@@ -945,6 +947,7 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
}
Builder.CreateMemCpy(DestPtr, SrcPtr,
- llvm::ConstantInt::get(IntPtrTy, TypeInfo.first/8),
- TypeInfo.second/8, isVolatile);
+ llvm::ConstantInt::get(IntPtrTy,
+ TypeInfo.first.getQuantity()),
+ TypeInfo.second.getQuantity(), isVolatile);
}
OpenPOWER on IntegriCloud