From a5032b26337bc7d877c3ab4e7f18265a3c044df9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 25 Mar 2022 22:42:41 +0000 Subject: 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) --- .../clang_llvm_roundtrip/simplified_template_names.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cross-project-tests') 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(); f1(); } +namespace complex_type_units { +void external_function(); +namespace { +struct internal_type; +} +template struct t2; +template > class t3 {}; +template > +struct t4 { +}; +struct t5 { + t4<> v1; +}; +void f1() { + t5 v1; + t3<> v2; +} +} -- cgit v1.2.1