r345109 - Debug Info (-gmodules): emit full types for non-anchored template specializations

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 29 12:32:18 PDT 2018



> On Oct 29, 2018, at 11:26 AM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> Is this a workaround for now with the intent to fix this to allow such implicit specializations to have their debug info modularized? I believe this does work correctly in modular debug info with expliict modules, would probably be sort of nice to have these things be consistent/similar?

It started as a workaround, but I reached the conclusion that it's not worthwhile pursuing a more space-efficient solution. Note that all this patch does is emit plain old non-modular debug info for non-explicit template specializations, so it is definitely safe & conservative. This increases the size of the clang module cache in a build of clang by 4MiB out of 1GiB total.

As you can read in my thread with Richard, it isn't possible in Clang to determine the clang module that contains the complete definition of a template specialization inside of a namespace for indirectly imported modules (such as in my testcase). That means that a consumer would have to look in every Clang module for complete types; not just in the transitive closure of imports of the .pcm that has the forward declaration. This lookup is expensive and difficult to implement in LLDB, so I decided not to pursue this further.

-- adrian


More information about the cfe-commits mailing list