Skip to content

Commit 93595e4

Browse files
committed
[NFC] IRGen: Extracted method.
1 parent cccaf01 commit 93595e4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lib/IRGen/Outlining.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ void OutliningMetadataCollector::collectTypeMetadataForLayout(SILType type) {
5959
return collectFormalTypeMetadata(formalType);
6060
}
6161

62-
auto key = LocalTypeDataKey(type.getASTType(),
63-
LocalTypeDataKind::forRepresentationTypeMetadata());
64-
if (Values.count(key)) return;
65-
66-
auto metadata = IGF.emitTypeMetadataRefForLayout(type);
67-
Values.insert({key, metadata});
62+
collectRepresentationTypeMetadata(type);
6863
}
6964

7065
void OutliningMetadataCollector::collectFormalTypeMetadata(CanType type) {
@@ -78,6 +73,15 @@ void OutliningMetadataCollector::collectFormalTypeMetadata(CanType type) {
7873
Values.insert({key, metadata});
7974
}
8075

76+
void OutliningMetadataCollector::collectRepresentationTypeMetadata(SILType ty) {
77+
auto key = LocalTypeDataKey(
78+
ty.getASTType(), LocalTypeDataKind::forRepresentationTypeMetadata());
79+
if (Values.count(key))
80+
return;
81+
82+
auto metadata = IGF.emitTypeMetadataRefForLayout(ty);
83+
Values.insert({key, metadata});
84+
}
8185

8286
void OutliningMetadataCollector::addMetadataArguments(
8387
SmallVectorImpl<llvm::Value*> &args) const {

lib/IRGen/Outlining.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class OutliningMetadataCollector {
6868
const TypeInfo &ti) const;
6969

7070
private:
71+
void collectRepresentationTypeMetadata(SILType ty);
72+
7173
void addMetadataArguments(SmallVectorImpl<llvm::Value *> &args) const ;
7274
void addMetadataParameterTypes(SmallVectorImpl<llvm::Type *> &paramTys) const;
7375
void bindMetadataParameters(IRGenFunction &helperIGF,

0 commit comments

Comments
 (0)