]> granicus.if.org Git - clang/commit
Emit debug info for dynamic classes if they are imported from a DLL.
authorAdrian McCarthy <amccarth@google.com>
Tue, 16 Aug 2016 22:11:18 +0000 (22:11 +0000)
committerAdrian McCarthy <amccarth@google.com>
Tue, 16 Aug 2016 22:11:18 +0000 (22:11 +0000)
commit7200cc30735502829d6dcec5fbc25e8d1f6c5f00
treeca78aa17ca0b5a952da2d4a98dfa0a5495b64524
parent79a88e31fbef287e5a4dcc53c301df6b825acfce
Emit debug info for dynamic classes if they are imported from a DLL.

With -debug-info-kind=limited, we omit debug info for dynamic classes that live in other TUs. This reduces duplicate type information. When statically linked, the type information comes together. But if your binary has a class derived from a base in a DLL, the base class info is not available to the debugger.

The decision is made in shouldOmitDefinition (CGDebugInfo.cpp). Per a suggestion from rnk, I've tweaked the decision so that we do include definitions for classes marked as DLL imports. This should be a relatively small number of classes, so we don't pay a large price for duplication of the type info, yet it should cover most cases on Windows.

Essentially this makes debug info for DLLs independent, but we still assume that all TUs within the same DLL will be consistently built with (or without) debug info and the debugger will be able to search across the debug info within that scope to resolve any declarations into definitions, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278861 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-dllimport-base-class.cpp [new file with mode: 0644]