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
This commit is contained in:
Ken Dyck 2011-04-24 17:08:00 +00:00
Родитель 243a4aa8af
Коммит 479b61ccd8
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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(),