AST: Introduce primitive AnyObject type

Add a 'hasExplicitAnyObject()' bit to ProtocolCompositionType
to represent canonical composition types containing '& AnyObject'.

Serialize this bit and take it into account when building
ExistentialLayouts.

Rename ProtocolCompositionType::getProtocols() to getMembers()
since it can contain classes now, and update a few usages that
need further attention with FIXMEs or asserts.

For now, nothing actually constructs these types, and they will
trigger arounds asserts. Upcoming patches will introduce support
for this.
This commit is contained in:
Slava Pestov
2017-04-13 01:00:25 -07:00
parent ce3f098021
commit d49f8fb6d9
22 changed files with 178 additions and 104 deletions

View File

@@ -477,7 +477,7 @@ static void passInherits(ArrayRef<TypeLoc> InheritedTypes,
if (auto ProtoComposition
= Inherited.getType()->getAs<ProtocolCompositionType>()) {
for (auto T : ProtoComposition->getProtocols())
for (auto T : ProtoComposition->getMembers())
passInherits(TypeLoc::withoutLoc(T), Consumer);
continue;
}