summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-04-24 17:08:00 +0000
committerKen Dyck <kd@kendyck.com>2011-04-24 17:08:00 +0000
commit3b4bd9a164bd734b806fefa7af911409d66ef327 (patch)
treee1ec8d32e82f6ddfbd5f82f2437b7880b63e1e22 /clang/lib/CodeGen
parenta8094505e2cb1017e5e83d8d0d9d6211fbcf31c5 (diff)
downloadbcm5719-llvm-3b4bd9a164bd734b806fefa7af911409d66ef327.tar.gz
bcm5719-llvm-3b4bd9a164bd734b806fefa7af911409d66ef327.zip
Eliminate some literal 8s by converting size variables in EmitGCMove() and
EmitFinalDestCopy() to CharUnits. No change in functionality intended. llvm-svn: 130110
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index db10ecede0b..e215da1e931 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/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(),
OpenPOWER on IntegriCloud