Skip to content

Commit c4139d6

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. (cherry picked from commit 61d14ed)
1 parent 0fa84fc commit c4139d6

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
@@ -2851,11 +2851,19 @@ struct TargetAnonymousContextDescriptor final
28512851
/// recorded in the metadata.
28522852
ConstTargetPointer<Runtime, char> getMangledName() const {
28532853
if (!hasMangledName())
2854-
return nullptr;
2854+
return ConstTargetPointer<Runtime, char>();
28552855

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

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

28762885
/// A protocol descriptor.
28772886
///

0 commit comments

Comments
 (0)