summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorKen Dyck <ken.dyck@onsemi.com>2010-01-27 17:10:57 +0000
committerKen Dyck <ken.dyck@onsemi.com>2010-01-27 17:10:57 +0000
commit160146eba2e08602c8e066d6752c792a64afcb6e (patch)
tree1d1ad2e6436a6d91c628aa6c5168d4c653f1f5d0 /clang/lib/CodeGen/CGDebugInfo.cpp
parentb925f7707e82b830719220e081c3f11127173d19 (diff)
downloadbcm5719-llvm-160146eba2e08602c8e066d6752c792a64afcb6e.tar.gz
bcm5719-llvm-160146eba2e08602c8e066d6752c792a64afcb6e.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index cb8752e7d57..3ef871816eb 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud