summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorPiotr Padlewski <prazek@google.com>2015-08-19 20:09:09 +0000
committerPiotr Padlewski <prazek@google.com>2015-08-19 20:09:09 +0000
commit1d02f681a94d7e898b16f8a79083a65f397c9d9d (patch)
tree23ee8a53b72632be45d255d30c58b7e796e7bad4 /clang/lib/CodeGen
parenta431f152dffa62b01b45d74119c7b04857bc25d8 (diff)
downloadbcm5719-llvm-1d02f681a94d7e898b16f8a79083a65f397c9d9d.tar.gz
bcm5719-llvm-1d02f681a94d7e898b16f8a79083a65f397c9d9d.zip
Generating available_externally vtables bugfix
Bugfix revealed in r245264. http://reviews.llvm.org/D12128 llvm-svn: 245489
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 09692754506..2eebf8ee673 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -306,17 +306,15 @@ public:
void emitCXXStructor(const CXXMethodDecl *MD, StructorType Type) override;
private:
- /// Checks if function has any virtual inline function.
- bool hasAnyVirtualInlineFunction(const CXXRecordDecl *RD) const {
+ bool hasAnyUsedVirtualInlineFunction(const CXXRecordDecl *RD) const {
const auto &VtableLayout =
CGM.getItaniumVTableContext().getVTableLayout(RD);
for (const auto &VtableComponent : VtableLayout.vtable_components()) {
- if (VtableComponent.getKind() !=
- VTableComponent::Kind::CK_FunctionPointer)
+ if (!VtableComponent.isUsedFunctionPointerKind())
continue;
- const auto &Method = VtableComponent.getFunctionDecl();
+ const CXXMethodDecl *Method = VtableComponent.getFunctionDecl();
if (Method->getCanonicalDecl()->isInlined())
return true;
}
@@ -1510,7 +1508,7 @@ bool ItaniumCXXABI::canEmitAvailableExternallyVTable(
// then we are safe to emit available_externally copy of vtable.
// FIXME we can still emit a copy of the vtable if we
// can emit definition of the inline functions.
- return !hasAnyVirtualInlineFunction(RD);
+ return !hasAnyUsedVirtualInlineFunction(RD);
}
static llvm::Value *performTypeAdjustment(CodeGenFunction &CGF,
llvm::Value *Ptr,
OpenPOWER on IntegriCloud