Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().
llvm-svn: 94681
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index cb8752e..3ef8718 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1333,10 +1333,11 @@
FieldOffset += FieldSize;
}
- unsigned Align = CGM.getContext().getDeclAlignInBytes(Decl);
- if (Align > CGM.getContext().Target.getPointerAlign(0) / 8) {
+ CharUnits Align = CGM.getContext().getDeclAlign(Decl);
+ if (Align > CharUnits::fromQuantity(
+ CGM.getContext().Target.getPointerAlign(0) / 8)) {
unsigned AlignedOffsetInBytes
- = llvm::RoundUpToAlignment(FieldOffset/8, Align);
+ = llvm::RoundUpToAlignment(FieldOffset/8, Align.getQuantity());
unsigned NumPaddingBytes
= AlignedOffsetInBytes - FieldOffset/8;
@@ -1359,7 +1360,7 @@
FType = Type;
FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
FieldSize = CGM.getContext().getTypeSize(FType);
- FieldAlign = Align*8;
+ FieldAlign = Align.getQuantity()*8;
FieldTy = DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, Unit,
Decl->getName(), DefUnit,
@@ -1510,10 +1511,11 @@
FieldOffset += FieldSize;
}
- unsigned Align = CGM.getContext().getDeclAlignInBytes(Decl);
- if (Align > CGM.getContext().Target.getPointerAlign(0) / 8) {
+ CharUnits Align = CGM.getContext().getDeclAlign(Decl);
+ if (Align > CharUnits::fromQuantity(
+ CGM.getContext().Target.getPointerAlign(0) / 8)) {
unsigned AlignedOffsetInBytes
- = llvm::RoundUpToAlignment(FieldOffset/8, Align);
+ = llvm::RoundUpToAlignment(FieldOffset/8, Align.getQuantity());
unsigned NumPaddingBytes
= AlignedOffsetInBytes - FieldOffset/8;
@@ -1536,7 +1538,7 @@
FType = Type;
FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
FieldSize = CGM.getContext().getTypeSize(FType);
- FieldAlign = Align*8;
+ FieldAlign = Align.getQuantity()*8;
XOffset = FieldOffset;
FieldTy = DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, Unit,