summaryrefslogtreecommitdiff
path: root/cross-project-tests
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2022-03-25 22:42:41 +0000
committerDavid Blaikie <dblaikie@gmail.com>2022-03-25 23:49:03 +0000
commita5032b26337bc7d877c3ab4e7f18265a3c044df9 (patch)
treed0ff0e7d72bdf66bd83a66be71d16e34fbe6954f /cross-project-tests
parent16eaa5240e30af36a91db387df3c2effff83e742 (diff)
downloadllvm-a5032b26337bc7d877c3ab4e7f18265a3c044df9.tar.gz
DebugInfo: Don't allow type units to references types in the CU
We could only do this in limited ways (since we emit the TUs first, we can't use ref_addr (& we can't use that in Split DWARF either) - so we had to synthesize declarations into the TUs) and they were ambiguous in some cases (if the CU type had internal linkage, parsing the TU would require knowing which CU was referencing the TU to know which type the declaration was for, which seems not-ideal). So to avoid all that, let's just not reference types defined in the CU from TUs - instead moving the TU type into the CU (recursively). This does increase debug info size (by pulling more things out of type units, into the compile unit) - about 2% of uncompressed dwp file size for clang -O0 -g -gsplit-dwarf. (5% .debug_info.dwo section size increase in the .dwp)
Diffstat (limited to 'cross-project-tests')
-rw-r--r--cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp b/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
index 5b1afcb29cc7..9bc14f8ce657 100644
--- a/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
+++ b/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp
@@ -333,3 +333,21 @@ void t8::mem() {
f1<t7>();
f1<decltype(&t8::mem)>();
}
+namespace complex_type_units {
+void external_function();
+namespace {
+struct internal_type;
+}
+template <void (*)() = external_function> struct t2;
+template <typename = t2<>> class t3 {};
+template <typename = internal_type, typename = t3<>>
+struct t4 {
+};
+struct t5 {
+ t4<> v1;
+};
+void f1() {
+ t5 v1;
+ t3<> v2;
+}
+}