aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index cb8752e7d5..3ef871816e 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1333,10 +1333,11 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
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 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
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 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
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 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
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,