[cfe-commits] r123720 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CodeGenModule.cpp
Ken Dyck
ken.dyck at onsemi.com
Mon Jan 17 18:01:14 PST 2011
Author: kjdyck
Date: Mon Jan 17 20:01:14 2011
New Revision: 123720
URL: http://llvm.org/viewvc/llvm-project?rev=123720&view=rev
Log:
Replace calls to CharUnits::fromQuantity() with ones to
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
Modified:
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=123720&r1=123719&r2=123720&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Mon Jan 17 20:01:14 2011
@@ -355,7 +355,7 @@
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 @@
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;
}
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=123720&r1=123719&r2=123720&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Jan 17 20:01:14 2011
@@ -1086,8 +1086,8 @@
}
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) {
More information about the cfe-commits
mailing list