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

Devang Patel dpatel at apple.com
Mon Feb 1 14:40:08 PST 2010


Author: dpatel
Date: Mon Feb  1 16:40:08 2010
New Revision: 95016

URL: http://llvm.org/viewvc/llvm-project?rev=95016&view=rev
Log:
Use appropriate context descriptor in RecordDecl's debug info.

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=95016&r1=95015&r2=95016&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Feb  1 16:40:08 2010
@@ -59,7 +59,7 @@
     I = RegionMap.find(Context);
   if (I != RegionMap.end())
     return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(I->second));
-  
+
   // Check namespace.
   if (const NamespaceDecl *NSDecl = dyn_cast<NamespaceDecl>(Context))
     return llvm::DIDescriptor(getOrCreateNameSpace(NSDecl, CompileUnit));
@@ -789,8 +789,11 @@
   // FIXME : Use RecordDecl's DeclContext's descriptor. As a temp. step
   // use type's name in FwdDecl.
   std::string STy = QualType(Ty, 0).getAsString();
+  llvm::DIDescriptor FDContext = 
+    getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit);
   llvm::DICompositeType FwdDecl =
-    DebugFactory.CreateCompositeType(Tag, Unit, STy.c_str(),
+    DebugFactory.CreateCompositeType(Tag, FDContext,
+                                     STy.c_str(),
                                      DefUnit, Line, 0, 0, 0, 0,
                                      llvm::DIType(), llvm::DIArray());
 
@@ -832,8 +835,11 @@
   uint64_t Size = CGM.getContext().getTypeSize(Ty);
   uint64_t Align = CGM.getContext().getTypeAlign(Ty);
 
+  llvm::DIDescriptor RDContext =  
+    getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit);
   llvm::DICompositeType RealDecl =
-    DebugFactory.CreateCompositeType(Tag, Unit, RD->getName(),
+    DebugFactory.CreateCompositeType(Tag, RDContext,
+                                     RD->getName(),
                                      DefUnit, Line, Size, Align, 0, 0, 
                                      llvm::DIType(), Elements, 
                                      0, ContainingType);





More information about the cfe-commits mailing list