diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-02-11 17:49:28 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-02-11 17:49:28 +0000 |
commit | 2d8b2008c85a88dfbd98949a315432e6d5fa77ac (patch) | |
tree | f0948df0f95c454fda71535e00c7365495f71812 /clang/lib/AST/VTableBuilder.cpp | |
parent | 2ad1f851a12a5e8da59a2c6753a8ce2f133835ad (diff) | |
download | bcm5719-llvm-2d8b2008c85a88dfbd98949a315432e6d5fa77ac.tar.gz bcm5719-llvm-2d8b2008c85a88dfbd98949a315432e6d5fa77ac.zip |
Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""
This reverts commit r260449.
We would supress our emission of vftable definitions if we thought
another translation unit would provide the definition because we saw an
explicit instantiation declaration. This is not the case with
dllimport, we want to synthesize a definition of the vftable regardless.
This fixes PR26569.
llvm-svn: 260548
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
-rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index bae018652f9..e43acc4de78 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -2416,7 +2416,7 @@ private: MethodVFTableLocationsTy MethodVFTableLocations; /// \brief Does this class have an RTTI component? - bool HasRTTIComponent; + bool HasRTTIComponent = false; /// MethodInfo - Contains information about a method in a vtable. /// (Used for computing 'this' pointer adjustment thunks. @@ -2546,11 +2546,13 @@ public: WhichVFPtr(*Which), Overriders(MostDerivedClass, CharUnits(), MostDerivedClass) { // Only include the RTTI component if we know that we will provide a - // definition of the vftable. - HasRTTIComponent = Context.getLangOpts().RTTIData && - !MostDerivedClass->hasAttr<DLLImportAttr>() && - MostDerivedClass->getTemplateSpecializationKind() != - TSK_ExplicitInstantiationDeclaration; + // definition of the vftable. We always provide the definition of + // dllimported classes. + if (Context.getLangOpts().RTTIData) + if (MostDerivedClass->hasAttr<DLLImportAttr>() || + MostDerivedClass->getTemplateSpecializationKind() != + TSK_ExplicitInstantiationDeclaration) + HasRTTIComponent = true; LayoutVFTable(); |