diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-27 17:10:57 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-27 17:10:57 +0000 |
commit | 8b752f10c394b140f9ef89e049cbad1a7676fc25 (patch) | |
tree | 89279a4ed37e601fa8e78a0c5bc5085d111a677d /lib/CodeGen/CGDebugInfo.cpp | |
parent | b176591b2e24a985fc90ee2d259f914ba3fcec5b (diff) |
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().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 18 |
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, |