mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
New implementation of dead function elimination, which includes dead method elimination.
If vtable or witness methods are never called, e.g. because they are completely devirtualized, then they are removed from the tables and eliminated. Another improvement of the new algorithm is that it is able to eliminate dead function cycles (e.g. A() calls B() and vice versa). Swift SVN r22969
This commit is contained in:
@@ -140,7 +140,7 @@ void SILWitnessTable::convertToDefinition(ArrayRef<Entry> entries,
|
||||
|
||||
void *buf = Mod.allocate(sizeof(Entry)*entries.size(), alignof(Entry));
|
||||
memcpy(buf, entries.begin(), sizeof(Entry)*entries.size());
|
||||
Entries = ArrayRef<Entry>(static_cast<Entry*>(buf), entries.size());
|
||||
Entries = MutableArrayRef<Entry>(static_cast<Entry*>(buf), entries.size());
|
||||
|
||||
// Bump the reference count of witness functions referenced by this table.
|
||||
for (auto entry : getEntries()) {
|
||||
|
||||
Reference in New Issue
Block a user