diff options
author | Reid Kleckner <rnk@google.com> | 2016-06-21 18:39:55 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-06-21 18:39:55 +0000 |
commit | 93b4b2e386209aa353091240c591ebeefae45bed (patch) | |
tree | 37793011e1819d0e8e2d0f96b090c6e967cf14dd /clang/lib/AST/VTableBuilder.cpp | |
parent | 14300261427ccc0cad744125959a9ae482ccc941 (diff) | |
download | bcm5719-llvm-93b4b2e386209aa353091240c591ebeefae45bed.tar.gz bcm5719-llvm-93b4b2e386209aa353091240c591ebeefae45bed.zip |
[MS] Don't expect vftables to be provided for extern template instantiations
MSVC doesn't provide them. PR28223
I left behind the machinery in case we want to resurrect available_externally
vftable emission to support devirtualization.
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D21544
llvm-svn: 273296
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
-rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index e43acc4de78..640fbf47aea 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -2545,14 +2545,13 @@ public: MostDerivedClassLayout(Context.getASTRecordLayout(MostDerivedClass)), WhichVFPtr(*Which), Overriders(MostDerivedClass, CharUnits(), MostDerivedClass) { - // Only include the RTTI component if we know that we will provide a - // definition of the vftable. We always provide the definition of - // dllimported classes. + // Provide the RTTI component if RTTIData is enabled. If the vftable would + // be available externally, we should not provide the RTTI componenent. It + // is currently impossible to get available externally vftables with either + // dllimport or extern template instantiations, but eventually we may add a + // flag to support additional devirtualization that needs this. if (Context.getLangOpts().RTTIData) - if (MostDerivedClass->hasAttr<DLLImportAttr>() || - MostDerivedClass->getTemplateSpecializationKind() != - TSK_ExplicitInstantiationDeclaration) - HasRTTIComponent = true; + HasRTTIComponent = true; LayoutVFTable(); |