Skip to content

Commit 61d14ed

Browse files
committed
[Remote AST] Use anonymous context descriptor mangled names for private types.
When an anonymous context descriptor provides a mangled name, use that mangled name to provide the private declaration name for its child context. This allows us to resolve private type names correctly when the corresponding anonymous context has its mangled name. Fixes rdar://problem/38231646.
1 parent 580c992 commit 61d14ed

File tree

4 files changed

+246
-80
lines changed

4 files changed

+246
-80
lines changed

include/swift/ABI/Metadata.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,11 +2852,19 @@ struct TargetAnonymousContextDescriptor final
28522852
/// recorded in the metadata.
28532853
ConstTargetPointer<Runtime, char> getMangledName() const {
28542854
if (!hasMangledName())
2855-
return nullptr;
2855+
return ConstTargetPointer<Runtime, char>();
28562856

28572857
return this->template getTrailingObjects<MangledContextName>()->name;
28582858
}
28592859

2860+
/// Retrieve a pointer to the mangled context name structure.
2861+
const MangledContextName *getMangledContextName() const {
2862+
if (!hasMangledName())
2863+
return nullptr;
2864+
2865+
return this->template getTrailingObjects<MangledContextName>();
2866+
}
2867+
28602868
private:
28612869
template<typename T>
28622870
using OverloadToken =
@@ -2873,6 +2881,7 @@ struct TargetAnonymousContextDescriptor final
28732881
return cd->getKind() == ContextDescriptorKind::Anonymous;
28742882
}
28752883
};
2884+
using AnonymousContextDescriptor = TargetAnonymousContextDescriptor<InProcess>;
28762885

28772886
/// A protocol descriptor.
28782887
///

0 commit comments

Comments
 (0)