diff options
author | Reid Kleckner <rnk@google.com> | 2016-06-21 19:51:52 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-06-21 19:51:52 +0000 |
commit | f981bcb3a05af0c69ea1c17dea553937688674a8 (patch) | |
tree | 15380dd8f9e1236a621436b9fe4b45815f25f058 /clang/lib/AST/VTableBuilder.cpp | |
parent | 47bd46395ad8496bd067d4e50f2ac5b196c09977 (diff) | |
download | bcm5719-llvm-f981bcb3a05af0c69ea1c17dea553937688674a8.tar.gz bcm5719-llvm-f981bcb3a05af0c69ea1c17dea553937688674a8.zip |
Revert "[MS] Don't expect vftables to be provided for extern template instantiations"
This reverts commit r273296, it broke the Windows self-host.
llvm-svn: 273305
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
-rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 640fbf47aea..e43acc4de78 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -2545,13 +2545,14 @@ public: MostDerivedClassLayout(Context.getASTRecordLayout(MostDerivedClass)), WhichVFPtr(*Which), Overriders(MostDerivedClass, CharUnits(), MostDerivedClass) { - // 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. + // 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. if (Context.getLangOpts().RTTIData) - HasRTTIComponent = true; + if (MostDerivedClass->hasAttr<DLLImportAttr>() || + MostDerivedClass->getTemplateSpecializationKind() != + TSK_ExplicitInstantiationDeclaration) + HasRTTIComponent = true; LayoutVFTable(); |