summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index 3aa06a91b84..5ccfb29b01a 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -843,18 +843,13 @@ bool DevirtIndex::tryFindVirtualCallTargets(
std::vector<ValueInfo> &TargetsForSlot, const TypeIdCompatibleVtableInfo TIdInfo,
uint64_t ByteOffset) {
for (const TypeIdOffsetVtableInfo &P : TIdInfo) {
- // Ensure that we have at most one external linkage vtable initializer.
- assert(P.VTableVI.getSummaryList().size() == 1 ||
- llvm::count_if(
- P.VTableVI.getSummaryList(),
- [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
- return GlobalValue::isExternalLinkage(Summary->linkage());
- }) <= 1);
// Find the first non-available_externally linkage vtable initializer.
// We can have multiple available_externally, linkonce_odr and weak_odr
// vtable initializers, however we want to skip available_externally as they
// do not have type metadata attached, and therefore the summary will not
- // contain any vtable functions.
+ // contain any vtable functions. We can also have multiple external
+ // vtable initializers in the case of comdats, which we cannot check here.
+ // The linker should give an error in this case.
//
// Also, handle the case of same-named local Vtables with the same path
// and therefore the same GUID. This can happen if there isn't enough
OpenPOWER on IntegriCloud