Skip to content

Commit c16e0cf

Browse files
committed
[sil] Implement helper function SILType::getFieldType(VarDecl *, SILFunction *) const.
This just calls: ``` SILType::getFieldType(VarDecl *, SILModule &, TypeExpansionContext) const ``` using the state in the SILFunction to handle the SILModule and TypeExpansionContext parameters. Just trimming down a larger commit into smaller commits.
1 parent f72816e commit c16e0cf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/swift/SIL/SILType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ class SILType {
495495
SILType getFieldType(VarDecl *field, SILModule &M,
496496
TypeExpansionContext context) const;
497497

498+
SILType getFieldType(VarDecl *field, SILFunction *fn) const;
499+
498500
/// Given that this is an enum type, return the lowered type of the
499501
/// data for the given element. Applies substitutions as necessary.
500502
/// The result will have the same value category as the base type.

lib/SIL/IR/SILType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ SILType SILType::getFieldType(VarDecl *field, SILModule &M,
320320
return getFieldType(field, M.Types, context);
321321
}
322322

323+
SILType SILType::getFieldType(VarDecl *field, SILFunction *fn) const {
324+
return getFieldType(field, fn->getModule(), fn->getTypeExpansionContext());
325+
}
326+
323327
SILType SILType::getEnumElementType(EnumElementDecl *elt, TypeConverter &TC,
324328
TypeExpansionContext context) const {
325329
assert(elt->getDeclContext() == getEnumOrBoundGenericEnum());

0 commit comments

Comments
 (0)