mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DefaultOverrides] SIL representation.
See the comment in SILDefaultOverrideTable.h for details.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "swift/SIL/FormalLinkage.h"
|
||||
#include "swift/SIL/Notifications.h"
|
||||
#include "swift/SIL/SILDebugScope.h"
|
||||
#include "swift/SIL/SILDefaultOverrideTable.h"
|
||||
#include "swift/SIL/SILMoveOnlyDeinit.h"
|
||||
#include "swift/SIL/SILRemarkStreamer.h"
|
||||
#include "swift/SIL/SILValue.h"
|
||||
@@ -290,6 +291,31 @@ void SILModule::deleteWitnessTable(SILWitnessTable *Wt) {
|
||||
witnessTables.erase(Wt);
|
||||
}
|
||||
|
||||
SILDefaultOverrideTable *SILModule::createDefaultOverrideTableDefinition(
|
||||
const ClassDecl *decl, SILLinkage linkage,
|
||||
ArrayRef<SILDefaultOverrideTable::Entry> entries) {
|
||||
return SILDefaultOverrideTable::define(*this, linkage, decl, entries);
|
||||
}
|
||||
|
||||
SILDefaultOverrideTable *
|
||||
SILModule::lookUpDefaultOverrideTable(const ClassDecl *decl,
|
||||
bool deserializeLazily) {
|
||||
// Note: we only ever look up default override tables in the translation unit
|
||||
// that is currently being compiled, since SILGen generates them when it
|
||||
// visits the class declaration, and IRGen emits them when emitting the
|
||||
// class descriptor metadata for the class.
|
||||
|
||||
auto found = DefaultOverrideTableMap.find(decl);
|
||||
if (found == DefaultOverrideTableMap.end()) {
|
||||
if (deserializeLazily) {
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return found->second;
|
||||
}
|
||||
|
||||
const IntrinsicInfo &SILModule::getIntrinsicInfo(Identifier ID) {
|
||||
unsigned OldSize = IntrinsicIDCache.size();
|
||||
IntrinsicInfo &Info = IntrinsicIDCache[ID];
|
||||
|
||||
Reference in New Issue
Block a user