aeubanks created this revision. aeubanks added reviewers: pcc, tejohnson. Herald added subscribers: ormris, steven_wu, hiraditya. Herald added a project: All. aeubanks requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
According to https://clang.llvm.org/docs/LTOVisibility.html, classes on Windows with dllimport/export receive public LTO visibility and therefore should not participate in WPD. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D129700 Files: clang/lib/CodeGen/CGVTables.cpp clang/test/CodeGenCXX/lto-visibility-inference.cpp Index: clang/test/CodeGenCXX/lto-visibility-inference.cpp =================================================================== --- clang/test/CodeGenCXX/lto-visibility-inference.cpp +++ clang/test/CodeGenCXX/lto-visibility-inference.cpp @@ -74,10 +74,10 @@ // MS: type.test{{.*}}!"?AUC2@@" c2->f(); // ITANIUM: type.test{{.*}}!"_ZTS2C3" - // MS: type.test{{.*}}!"?AUC3@@" + // MS-NOT: type.test{{.*}}!"?AUC3@@" c3->f(); // ITANIUM: type.test{{.*}}!"_ZTS2C4" - // MS: type.test{{.*}}!"?AUC4@@" + // MS-NOT: type.test{{.*}}!"?AUC4@@" c4->f(); // ITANIUM-NOT: type.test{{.*}}!"_ZTS2C5" // MS-NOT: type.test{{.*}}!"?AUC5@@" Index: clang/lib/CodeGen/CGVTables.cpp =================================================================== --- clang/lib/CodeGen/CGVTables.cpp +++ clang/lib/CodeGen/CGVTables.cpp @@ -1176,7 +1176,8 @@ } bool CodeGenModule::AlwaysHasLTOVisibilityPublic(const CXXRecordDecl *RD) { - if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>()) + if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>() || + RD->hasAttr<DLLExportAttr>() || RD->hasAttr<DLLImportAttr>()) return true; if (!getCodeGenOpts().LTOVisibilityPublicStd)
Index: clang/test/CodeGenCXX/lto-visibility-inference.cpp =================================================================== --- clang/test/CodeGenCXX/lto-visibility-inference.cpp +++ clang/test/CodeGenCXX/lto-visibility-inference.cpp @@ -74,10 +74,10 @@ // MS: type.test{{.*}}!"?AUC2@@" c2->f(); // ITANIUM: type.test{{.*}}!"_ZTS2C3" - // MS: type.test{{.*}}!"?AUC3@@" + // MS-NOT: type.test{{.*}}!"?AUC3@@" c3->f(); // ITANIUM: type.test{{.*}}!"_ZTS2C4" - // MS: type.test{{.*}}!"?AUC4@@" + // MS-NOT: type.test{{.*}}!"?AUC4@@" c4->f(); // ITANIUM-NOT: type.test{{.*}}!"_ZTS2C5" // MS-NOT: type.test{{.*}}!"?AUC5@@" Index: clang/lib/CodeGen/CGVTables.cpp =================================================================== --- clang/lib/CodeGen/CGVTables.cpp +++ clang/lib/CodeGen/CGVTables.cpp @@ -1176,7 +1176,8 @@ } bool CodeGenModule::AlwaysHasLTOVisibilityPublic(const CXXRecordDecl *RD) { - if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>()) + if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>() || + RD->hasAttr<DLLExportAttr>() || RD->hasAttr<DLLImportAttr>()) return true; if (!getCodeGenOpts().LTOVisibilityPublicStd)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits