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

Devang Patel dpatel at apple.com
Wed Jan 20 15:56:40 PST 2010


Author: dpatel
Date: Wed Jan 20 17:56:40 2010
New Revision: 94050

URL: http://llvm.org/viewvc/llvm-project?rev=94050&view=rev
Log:
 A Decl->getName() is not unique. However, the debug info descriptors 
 are uniqued. The debug info descriptor describing record's context is
necessary to keep two Decl's descriptor unique if their name match.

There is more work to do to create descriptors for DeclContext. 
As a temp. step use type's name in FwdDecl.


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=94050&r1=94049&r2=94050&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Jan 20 17:56:40 2010
@@ -609,8 +609,15 @@
   // its members.  Finally, we create a descriptor for the complete type (which
   // may refer to the forward decl if the struct is recursive) and replace all
   // uses of the forward declaration with the final definition.
+
+  // A Decl->getName() is not unique. However, the debug info descriptors 
+  // are uniqued. The debug info descriptor describing record's context is
+  // necessary to keep two Decl's descriptor unique if their name match.
+  // 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::DICompositeType FwdDecl =
-    DebugFactory.CreateCompositeType(Tag, Unit, Decl->getName(),
+    DebugFactory.CreateCompositeType(Tag, Unit, STy.c_str(),
                                      DefUnit, Line, 0, 0, 0, 0,
                                      llvm::DIType(), llvm::DIArray());
 





More information about the cfe-commits mailing list