diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2011-01-18 02:01:14 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2011-01-18 02:01:14 +0000 |
commit | 06f486ecd05bd6788da97c39164c1903a084c26d (patch) | |
tree | d2acb6b7f57a26684275831478711ff0563b1731 | |
parent | dec0984fce504a39a7f085774fb67cfd9957be58 (diff) |
Replace calls to CharUnits::fromQuantity() with ones to
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123720 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 16a3a196bb..8270e84cb5 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -355,7 +355,7 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const ValueDecl *D) { bool Packed = false; CharUnits Align = getContext().getDeclAlign(D); - if (Align > CharUnits::fromQuantity(Target.getPointerAlign(0) / 8)) { + if (Align > getContext().toCharUnitsFromBits(Target.getPointerAlign(0))) { // We have to insert padding. // The struct above has 2 32-bit integers. @@ -657,7 +657,7 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D, Align = getContext().getDeclAlign(&D); if (isByRef) Align = std::max(Align, - CharUnits::fromQuantity(Target.getPointerAlign(0) / 8)); + getContext().toCharUnitsFromBits(Target.getPointerAlign(0))); Alloc->setAlignment(Align.getQuantity()); DeclPtr = Alloc; } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index ed3a117ef7..42d5e7923f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1086,8 +1086,8 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) { } CharUnits CodeGenModule::GetTargetTypeStoreSize(const llvm::Type *Ty) const { - return CharUnits::fromQuantity( - TheTargetData.getTypeStoreSizeInBits(Ty) / Context.getCharWidth()); + return Context.toCharUnitsFromBits( + TheTargetData.getTypeStoreSizeInBits(Ty)); } void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { |