Skip to content

Commit 76c7be7

Browse files
committed
Refactor: introduce SILModule::getMaximalTypeExpansionContext()
1 parent 51c1358 commit 76c7be7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

include/swift/SIL/SILModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,8 @@ class SILModule {
999999

10001000
IndexTrieNode *getIndexTrieRoot() { return indexTrieRoot.get(); }
10011001

1002+
TypeExpansionContext getMaximalTypeExpansionContext() const;
1003+
10021004
/// Can value operations (copies and destroys) on the given lowered type
10031005
/// be performed in this module?
10041006
bool isTypeABIAccessible(SILType type,

lib/IRGen/IRGenModule.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,8 +2372,7 @@ const llvm::StringRef IRGenerator::getClangDataLayoutString() {
23722372
}
23732373

23742374
TypeExpansionContext IRGenModule::getMaximalTypeExpansionContext() const {
2375-
return TypeExpansionContext::maximal(getSILModule().getAssociatedContext(),
2376-
getSILModule().isWholeModule());
2375+
return getSILModule().getMaximalTypeExpansionContext();
23772376
}
23782377

23792378
const TypeLayoutEntry

lib/SIL/IR/SILModule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,10 @@ void SILModule::moveAfter(SILModule::iterator moveAfter, SILFunction *fn) {
10811081
getFunctionList().insertAfter(moveAfter, fn);
10821082
}
10831083

1084+
TypeExpansionContext SILModule::getMaximalTypeExpansionContext() const {
1085+
return TypeExpansionContext::maximal(getAssociatedContext(), isWholeModule());
1086+
}
1087+
10841088
SILProperty *
10851089
SILProperty::create(SILModule &M, unsigned Serialized, AbstractStorageDecl *Decl,
10861090
std::optional<KeyPathPatternComponent> Component) {

0 commit comments

Comments
 (0)