[SIL] NFC: Simplify SILVTable and save 8 bytes per SILVTable

We were not using the primary benefits of an intrusive list, namely the
ability to insert or remove from the middle of the list, so let's switch
to a plain vector. This also avoids linked-list pointer chasing.
This commit is contained in:
David Zarzycki
2020-06-08 10:42:04 -04:00
parent fe8893da96
commit 017ee7bf04
14 changed files with 53 additions and 58 deletions

View File

@@ -29,8 +29,6 @@
#include "swift/SIL/SILAllocated.h"
#include "swift/SIL/SILDeclRef.h"
#include "swift/SIL/SILFunction.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/Optional.h"
#include <algorithm>
@@ -44,8 +42,7 @@ class SILModule;
/// A mapping from each dynamically-dispatchable method of a class to the
/// SILFunction that implements the method for that class.
/// Note that dead methods are completely removed from the vtable.
class SILVTable : public llvm::ilist_node<SILVTable>,
public SILAllocated<SILVTable> {
class SILVTable : public SILAllocated<SILVTable> {
public:
// TODO: Entry should include substitutions needed to invoke an overridden
// generic base class method.