[PATCH] D23462: Emit debug info for dynamic classes if they are imported from a DLL

Adrian McCarthy via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 16 11:02:29 PDT 2016


amccarth added inline comments.

================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1688-1689
@@ -1687,3 +1687,4 @@
 
-  if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass())
+  if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass() &&
+      !CXXDecl->hasAttr<DLLImportAttr>())
     return true;
----------------
rnk wrote:
> David, since we're doing this check to work around a limitation of PDB-based debuggers, do you think we should guard check with EmitCodeView, so that we don't emit the full type if we're emitting DWARF?
> 
> After that, I'd add a comment like:
>   // Only emit complete debug info for a dynamic class when its vtable is emitted. However,
>   // Microsoft debuggers are unable to resolve type information across DLL boundaries,
>   // so skip this optimization if the class is marked dllimport.
Comment added.

I don't think the EmitCodeView check is necessary because it seems unlikely the DLLImportAttr would be set with DWARF debug info, and, even if it is, I wouldn't expect it to do any harm.  But I'll defer to dblaikie or other DWARF experts.


https://reviews.llvm.org/D23462





More information about the cfe-commits mailing list