Skip to content

Commit 39e6ac3

Browse files
authored
Merge pull request #65525 from tbkka/5.9-tbkka-RemoteMirror-MPE-zero-sized-plus-generics
5.9 [RemoteMirror] Fix handling of generic and zero-sized cases in MPEs
2 parents a2cfb6b + c33c14d commit 39e6ac3

17 files changed

+1346
-349
lines changed

include/swift/RemoteInspection/TypeRef.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ class alignas(8) TypeRef {
216216
const TypeRef *subst(TypeRefBuilder &Builder,
217217
const GenericArgumentMap &Subs) const;
218218

219+
const TypeRef *subst(TypeRefBuilder &Builder,
220+
const GenericArgumentMap &Subs,
221+
bool &DidSubstitute) const;
222+
219223
llvm::Optional<GenericArgumentMap> getSubstMap() const;
220224

221225
virtual ~TypeRef() = default;

include/swift/RemoteInspection/TypeRefBuilder.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,18 @@ struct FieldTypeInfo {
288288
int Value;
289289
const TypeRef *TR;
290290
bool Indirect;
291+
bool Generic;
291292

292-
FieldTypeInfo() : Name(""), Value(0), TR(nullptr), Indirect(false) {}
293-
FieldTypeInfo(const std::string &Name, int Value, const TypeRef *TR, bool Indirect)
294-
: Name(Name), Value(Value), TR(TR), Indirect(Indirect) {}
293+
FieldTypeInfo() : Name(""), Value(0), TR(nullptr), Indirect(false), Generic(false) {}
294+
FieldTypeInfo(const std::string &Name, int Value, const TypeRef *TR, bool Indirect, bool Generic)
295+
: Name(Name), Value(Value), TR(TR), Indirect(Indirect), Generic(Generic) {}
295296

296297
static FieldTypeInfo forEmptyCase(std::string Name, int Value) {
297-
return FieldTypeInfo(Name, Value, nullptr, false);
298-
}
299-
300-
static FieldTypeInfo forIndirectCase(std::string Name, int Value, const TypeRef *TR) {
301-
return FieldTypeInfo(Name, Value, TR, true);
298+
return FieldTypeInfo(Name, Value, nullptr, false, false);
302299
}
303300

304301
static FieldTypeInfo forField(std::string Name, int Value, const TypeRef *TR) {
305-
return FieldTypeInfo(Name, Value, TR, false);
302+
return FieldTypeInfo(Name, Value, TR, false, false);
306303
}
307304
};
308305

0 commit comments

Comments
 (0)