diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
commit | 199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 (patch) | |
tree | 6cd559c088b3da1861835639e05db09d5bb16f08 /lib/CodeGen/CGExpr.cpp | |
parent | e27d87ff27b26e5886cf6472271d3b5e18ec3d87 (diff) |
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 5809d1e70d..2358bb3592 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1273,16 +1273,16 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { QualType BaseType = getContext().getBaseElementType(VAT); - uint64_t BaseTypeSize = getContext().getTypeSize(BaseType) / 8; + CharUnits BaseTypeSize = getContext().getTypeSizeInChars(BaseType); Idx = Builder.CreateUDiv(Idx, llvm::ConstantInt::get(Idx->getType(), - BaseTypeSize)); + BaseTypeSize.getQuantity())); Address = Builder.CreateInBoundsGEP(Base, Idx, "arrayidx"); } else if (const ObjCInterfaceType *OIT = dyn_cast<ObjCInterfaceType>(E->getType())) { llvm::Value *InterfaceSize = llvm::ConstantInt::get(Idx->getType(), - getContext().getTypeSize(OIT) / 8); + getContext().getTypeSizeInChars(OIT).getQuantity()); Idx = Builder.CreateMul(Idx, InterfaceSize); |