amccarth created this revision. amccarth added a reviewer: rnk. amccarth added a subscriber: cfe-commits.
With -debug-info-kind=limited, we omit debug info for abstract 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. Tested manually on Windows. I'm working on a lit test, and I'll update this patch with it when it's finished. https://reviews.llvm.org/D23462 Files: lib/CodeGen/CGDebugInfo.cpp Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -1685,7 +1685,8 @@ if (!CXXDecl) return false; - if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass()) + if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass() && + !CXXDecl->hasAttr<DLLImportAttr>()) return true; TemplateSpecializationKind Spec = TSK_Undeclared;
Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -1685,7 +1685,8 @@ if (!CXXDecl) return false; - if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass()) + if (CXXDecl->hasDefinition() && CXXDecl->isDynamicClass() && + !CXXDecl->hasAttr<DLLImportAttr>()) return true; TemplateSpecializationKind Spec = TSK_Undeclared;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits