summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
authorJorge Gorbe Moya <jgorbe@google.com>2019-10-14 23:25:25 +0000
committerJorge Gorbe Moya <jgorbe@google.com>2019-10-14 23:25:25 +0000
commitb052331bd614ff2d06bbb3e5af15e899e3f7e52f (patch)
tree820eb125616254eeeefc9d6ad5d3c3c174ed78b9 /clang/lib/CodeGen/CGVTables.cpp
parent3be9169caab619c9c87ec29b5530bd2db8382938 (diff)
downloadbcm5719-llvm-b052331bd614ff2d06bbb3e5af15e899e3f7e52f.tar.gz
bcm5719-llvm-b052331bd614ff2d06bbb3e5af15e899e3f7e52f.zip
Revert "Dead Virtual Function Elimination"
This reverts commit 9f6a873268e1ad9855873d9d8007086c0d01cf4f. llvm-svn: 374844
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index f9f25e7e57a..a74905fd70f 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -808,7 +808,7 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD,
assert(!VTable->isDeclaration() && "Shouldn't set properties on declaration");
CGM.setGVProperties(VTable, RD);
- CGM.EmitVTableTypeMetadata(RD, VTable, *VTLayout.get());
+ CGM.EmitVTableTypeMetadata(VTable, *VTLayout.get());
return VTable;
}
@@ -1039,32 +1039,7 @@ bool CodeGenModule::HasHiddenLTOVisibility(const CXXRecordDecl *RD) {
return true;
}
-llvm::GlobalObject::VCallVisibility
-CodeGenModule::GetVCallVisibilityLevel(const CXXRecordDecl *RD) {
- LinkageInfo LV = RD->getLinkageAndVisibility();
- llvm::GlobalObject::VCallVisibility TypeVis;
- if (!isExternallyVisible(LV.getLinkage()))
- TypeVis = llvm::GlobalObject::VCallVisibilityTranslationUnit;
- else if (HasHiddenLTOVisibility(RD))
- TypeVis = llvm::GlobalObject::VCallVisibilityLinkageUnit;
- else
- TypeVis = llvm::GlobalObject::VCallVisibilityPublic;
-
- for (auto B : RD->bases())
- if (B.getType()->getAsCXXRecordDecl()->isDynamicClass())
- TypeVis = std::min(TypeVis,
- GetVCallVisibilityLevel(B.getType()->getAsCXXRecordDecl()));
-
- for (auto B : RD->vbases())
- if (B.getType()->getAsCXXRecordDecl()->isDynamicClass())
- TypeVis = std::min(TypeVis,
- GetVCallVisibilityLevel(B.getType()->getAsCXXRecordDecl()));
-
- return TypeVis;
-}
-
-void CodeGenModule::EmitVTableTypeMetadata(const CXXRecordDecl *RD,
- llvm::GlobalVariable *VTable,
+void CodeGenModule::EmitVTableTypeMetadata(llvm::GlobalVariable *VTable,
const VTableLayout &VTLayout) {
if (!getCodeGenOpts().LTOUnit)
return;
@@ -1124,10 +1099,4 @@ void CodeGenModule::EmitVTableTypeMetadata(const CXXRecordDecl *RD,
VTable->addTypeMetadata((PointerWidth * I).getQuantity(), MD);
}
}
-
- if (getCodeGenOpts().VirtualFunctionElimination) {
- llvm::GlobalObject::VCallVisibility TypeVis = GetVCallVisibilityLevel(RD);
- if (TypeVis != llvm::GlobalObject::VCallVisibilityPublic)
- VTable->addVCallVisibilityMetadata(TypeVis);
- }
}
OpenPOWER on IntegriCloud