[cfe-commits] r82512 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Mike Stump mrs at apple.com
Mon Sep 21 19:44:18 PDT 2009


Author: mrs
Date: Mon Sep 21 21:44:17 2009
New Revision: 82512

URL: http://llvm.org/viewvc/llvm-project?rev=82512&view=rev
Log:
Fix some typos.  WIP.  Large alignments don't work yet.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=82512&r1=82511&r2=82512&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Sep 21 21:44:17 2009
@@ -1009,9 +1009,9 @@
     unsigned Align = M->getContext().getDeclAlignInBytes(Decl);
     if (Align > M->getContext().Target.getPointerAlign(0) / 8) {
       unsigned AlignedOffsetInBytes
-        = llvm::RoundUpToAlignment(FieldOffset, Align);
+        = llvm::RoundUpToAlignment(FieldOffset/8, Align);
       unsigned NumPaddingBytes
-        = AlignedOffsetInBytes = FieldOffset;
+        = AlignedOffsetInBytes - FieldOffset/8;
 
       if (NumPaddingBytes > 0) {
         llvm::APInt pad(32, NumPaddingBytes);
@@ -1032,7 +1032,7 @@
     FType = Type;
     FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
     FieldSize = M->getContext().getTypeSize(FType);
-    FieldAlign = M->getContext().getTypeAlign(FType);
+    FieldAlign = Align*8;
     std::string Name = Decl->getNameAsString();
     
     FieldTy = DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_member, Unit,





More information about the cfe-commits mailing list