summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/VTableBuilder.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-06-29 18:29:21 +0000
committerReid Kleckner <rnk@google.com>2016-06-29 18:29:21 +0000
commitad1e22bf335041cae1740b19a46f18932c374f27 (patch)
treec8a537770b810bac861e3134b39f9934f7cc2fef /clang/lib/AST/VTableBuilder.cpp
parent4561e784f47cbf8491da177316cba4840b3f440f (diff)
downloadbcm5719-llvm-ad1e22bf335041cae1740b19a46f18932c374f27.tar.gz
bcm5719-llvm-ad1e22bf335041cae1740b19a46f18932c374f27.zip
Re-land "[MS] Don't expect vftables to be provided for extern template instantiations"
Reverts r273305 and re-instates r273296. We needed to fix a bug in Sema::MarkVTableUsed to ensure that operator delete lookup occurs when the vtable is referenced. We already had a special case to look up operator delete when dllimport was used, but I think should really mark virtual destructors referenced any time the vtable is used. llvm-svn: 274147
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
-rw-r--r--clang/lib/AST/VTableBuilder.cpp13
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();
OpenPOWER on IntegriCloud