summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-20 23:56:40 +0000
committerDevang Patel <dpatel@apple.com>2010-01-20 23:56:40 +0000
commit3f4a77e08283a2d1c6149dcf37286b1bca10f39c (patch)
tree035ec1e11c4c4d4c0566e2e868119649c343a4b7 /clang/lib/CodeGen/CGDebugInfo.cpp
parent58552bcd65fc18d9bfc57563cc095d1fa2ba3b4c (diff)
downloadbcm5719-llvm-3f4a77e08283a2d1c6149dcf37286b1bca10f39c.tar.gz
bcm5719-llvm-3f4a77e08283a2d1c6149dcf37286b1bca10f39c.zip
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. llvm-svn: 94050
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index d9c1e00012d..1ffad3edcac 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -609,8 +609,15 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
// 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());
OpenPOWER on IntegriCloud