From f1acc31e4586dfec00a20e82094f7ad782d50cc3 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Thu, 29 Aug 2013 18:51:51 +0000 Subject: Debug Info: generate a unique identifier for C++ struct, class, union, and enum. We use CXX mangler to generate unique identifier for external C++ struct, union, class and enum. Types with unique identifier are added to RetainedTypes to make sure they are treated as used even when all uses are replaced with the identifiers. A single type can be added to RetainedTypes multiple times. For example, both createForwardDecl and createLimitedType can add the same type to RetainedTypes. A set is used to avoid duplication when updating AllRetainTypes in DIBuilder. Testing cases are updated to reflect the unique identifier generated for types. The order of MDNodes is changed because of retained types and testing cases are updated accordingly. Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since uuid is not yet handled in Itanium mangler. We choose to update RetainedTypes in clang, then at finalize(), we update AllRetainTypes in DIBuilder. The other choice is to update AllRetainTypes in DIBuilder when creating a DICompositeType with unique identifier. This option requires using ValueHandle for AllRetainTypes in DIBuilder since the created DICompositeType can be modified later on by setContainingType etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189600 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/debug-info-decl-nested.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/CodeGenCXX/debug-info-decl-nested.cpp') diff --git a/test/CodeGenCXX/debug-info-decl-nested.cpp b/test/CodeGenCXX/debug-info-decl-nested.cpp index 7c8bd1facf..8bfa1d01d7 100644 --- a/test/CodeGenCXX/debug-info-decl-nested.cpp +++ b/test/CodeGenCXX/debug-info-decl-nested.cpp @@ -35,11 +35,11 @@ class OuterClass1 public: InnerClass1(); } theInnerClass1; -// CHECK1: metadata {{.*}}, metadata ![[DECL:[0-9]+]], metadata {{.*}}, i32 [[@LINE+5]]} ; [ DW_TAG_subprogram ] [line [[@LINE+5]]] [def] [Bar] +// CHECK1: [[DECL:[0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE+2]]] [private] [Bar] +// CHECK1: metadata {{.*}}, metadata ![[DECL]], metadata {{.*}}, i32 [[@LINE+4]]} ; [ DW_TAG_subprogram ] [line [[@LINE+4]]] [def] [Bar] void Bar(const Foo1 *); }; OuterClass1::InnerClass1 OuterClass1::theInnerClass1; -// CHECK1: [[DECL]] = {{.*}} ; [ DW_TAG_subprogram ] [line [[@LINE-3]]] [private] [Bar] void OuterClass1::Bar(const Foo1 *meta) { } -- cgit v1.2.3