diff options
author | Ken Dyck <kd@kendyck.com> | 2011-04-24 17:08:00 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-04-24 17:08:00 +0000 |
commit | 479b61ccd8cd847281eef0b43e6873f0930f1b98 (patch) | |
tree | 19333c963083e8b5189f249b2f1c8431733549ba /lib/CodeGen/CGExprAgg.cpp | |
parent | 243a4aa8afd19df52f21db4afb665c4d8b22ef66 (diff) |
Eliminate some literal 8s by converting size variables in EmitGCMove() and
EmitFinalDestCopy() to CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index db10ecede0..e215da1e93 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -182,9 +182,9 @@ bool AggExprEmitter::TypeRequiresGCollection(QualType T) { /// move will be performed. void AggExprEmitter::EmitGCMove(const Expr *E, RValue Src) { if (Dest.requiresGCollection()) { - uint64_t size = CGF.getContext().getTypeSize(E->getType())/8; + CharUnits size = CGF.getContext().getTypeSizeInChars(E->getType()); const llvm::Type *SizeTy = CGF.ConvertType(CGF.getContext().getSizeType()); - llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size); + llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size.getQuantity()); CGF.CGM.getObjCRuntime().EmitGCMemmoveCollectable(CGF, Dest.getAddr(), Src.getAggregateAddr(), SizeVal); @@ -213,9 +213,9 @@ void AggExprEmitter::EmitFinalDestCopy(const Expr *E, RValue Src, bool Ignore) { } if (Dest.requiresGCollection()) { - uint64_t size = CGF.getContext().getTypeSize(E->getType())/8; + CharUnits size = CGF.getContext().getTypeSizeInChars(E->getType()); const llvm::Type *SizeTy = CGF.ConvertType(CGF.getContext().getSizeType()); - llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size); + llvm::Value *SizeVal = llvm::ConstantInt::get(SizeTy, size.getQuantity()); CGF.CGM.getObjCRuntime().EmitGCMemmoveCollectable(CGF, Dest.getAddr(), Src.getAggregateAddr(), |