summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-08-29 18:51:51 +0000
committerManman Ren <manman.ren@gmail.com>2013-08-29 18:51:51 +0000
commit035c4b029f970c141d0a782c1ad8a5c979b6a1e2 (patch)
tree2a9e3be18e4eb082bb56b8664a496ca257278024 /clang/test/CodeGenCXX/debug-info.cpp
parent13cf3beeb3c42d1ca4df3d8578a3f29e1e2f9d6c (diff)
downloadbcm5719-llvm-035c4b029f970c141d0a782c1ad8a5c979b6a1e2.tar.gz
bcm5719-llvm-035c4b029f970c141d0a782c1ad8a5c979b6a1e2.zip
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. llvm-svn: 189600
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/test/CodeGenCXX/debug-info.cpp b/clang/test/CodeGenCXX/debug-info.cpp
index dc7895363cf..8ef8aa7bb86 100644
--- a/clang/test/CodeGenCXX/debug-info.cpp
+++ b/clang/test/CodeGenCXX/debug-info.cpp
@@ -77,9 +77,15 @@ foo func(foo f) {
return f; // reference 'f' for now because otherwise we hit another bug
}
+// CHECK: [[FOO:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[PR14763:![0-9]*]], {{.*}} ; [ DW_TAG_structure_type ] [foo]
+// CHECK: [[PR14763]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763]
+// CHECK: [[INCTYPE:![0-9]*]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl]
+// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null, metadata !"_ZTSN7pr162141aE"} ; [ DW_TAG_structure_type ] [a]
+// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]]}
+// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
+// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl]
+
// CHECK: [[FUNC:![0-9]*]] = {{.*}} metadata !"_ZN7pr147634funcENS_3fooE", i32 {{[0-9]*}}, metadata [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
-// CHECK: [[PR14763:![0-9]*]] = {{.*}} ; [ DW_TAG_namespace ] [pr14763]
-// CHECK: [[FOO:![0-9]*]] = metadata !{i32 {{[0-9]*}}, metadata !{{[0-9]*}}, metadata [[PR14763]], {{.*}} ; [ DW_TAG_structure_type ] [foo]
}
namespace pr9608 { // also pr9600
@@ -87,8 +93,7 @@ struct incomplete;
incomplete (*x)[3];
// CHECK: metadata [[INCARRAYPTR:![0-9]*]], i32 0, i32 1, [3 x i8]** @_ZN6pr96081xE, null} ; [ DW_TAG_variable ] [x]
// CHECK: [[INCARRAYPTR]] = {{.*}}metadata [[INCARRAY:![0-9]*]]} ; [ DW_TAG_pointer_type ]
-// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE:![0-9]*]], metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
-// CHECK: [[INCTYPE]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [decl]
+// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE]], metadata {{![0-9]*}}, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
}
// For some reason the argument for PR14763 ended up all the way down here
@@ -112,8 +117,4 @@ void func() {
const bt *b_cnst_ptr_inst;
}
-// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null, null} ; [ DW_TAG_structure_type ] [a]
-// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]]}
-// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
-// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[decl]
}
OpenPOWER on IntegriCloud