[llvm-commits] [llvm-gcc-4.2] r94588 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Devang Patel dpatel at apple.com
Tue Jan 26 13:18:16 PST 2010


Author: dpatel
Date: Tue Jan 26 15:18:16 2010
New Revision: 94588

URL: http://llvm.org/viewvc/llvm-project?rev=94588&view=rev
Log:
Fix vtable index.
Set containing type (a class that holds current class's vtable) entry.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=94588&r1=94587&r2=94588&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Jan 26 15:18:16 2010
@@ -322,6 +322,8 @@
   unsigned VIndex = 0;
   DIType ContainingType;
   if (DECL_VINDEX (FnDecl)) {
+    if (host_integerp (DECL_VINDEX (FnDecl), 0))
+      VIndex = tree_low_cst (DECL_VINDEX (FnDecl), 0);
     Virtuality = dwarf::DW_VIRTUALITY_virtual;
     ContainingType = getOrCreateType(DECL_CONTEXT (FnDecl));
   }
@@ -957,6 +959,8 @@
       unsigned VIndex = 0;
       DIType ContainingType;
       if (DECL_VINDEX (Member)) {
+        if (host_integerp (DECL_VINDEX (Member), 0))
+          VIndex = tree_low_cst (DECL_VINDEX (Member), 0);
         Virtuality = dwarf::DW_VIRTUALITY_virtual;
         ContainingType = getOrCreateType(DECL_CONTEXT(Member));
       }
@@ -980,6 +984,11 @@
   if (RI != RegionMap.end())
     RegionMap.erase(RI);
 
+  llvm::DIType ContainingType;
+  if (TYPE_VFIELD (type)) {
+    tree vtype = DECL_FCONTEXT (TYPE_VFIELD (type));
+    ContainingType = getOrCreateType(vtype);
+  }
   llvm::DICompositeType RealDecl =
     DebugFactory.CreateCompositeType(Tag, findRegion(TYPE_CONTEXT(type)),
                                      GetNodeName(type),
@@ -987,7 +996,7 @@
                                      Loc.line, 
                                      NodeSizeInBits(type), NodeAlignInBits(type),
                                      0, SFlags, llvm::DIType(), Elements,
-                                     RunTimeLang);
+                                     RunTimeLang, ContainingType.getNode());
   RegionMap[type] = WeakVH(RealDecl.getNode());
 
   // Now that we have a real decl for the struct, replace anything using the





More information about the llvm-commits mailing list