[serialization] Handle cross-module references to values in extensions.

Previously, cross-references used a simple access path to refer to values
in other modules, but extensions have no name. They also accidentally
picked up values in extensions anyway, because lookupDirect includes
members in extensions. Now, we filter out values that don't come from
the referenced module, which may not be the same module the base type
comes from.

Swift SVN r6301
This commit is contained in:
Jordan Rose
2013-07-16 23:10:33 +00:00
parent 213829f946
commit 6e4f36cab2
5 changed files with 80 additions and 39 deletions

View File

@@ -72,9 +72,10 @@ using AbstractCCField = BCFixed<2>;
// VERSION_MAJOR.
enum XRefKind : uint8_t {
SwiftValue = 0,
SwiftExtensionValue,
SwiftOperator
};
using XRefKindField = BCFixed<1>;
using XRefKindField = BCFixed<2>;
// These IDs must \em not be renumbered or reordered without incrementing
// VERSION_MAJOR.
@@ -637,7 +638,9 @@ namespace decls_block {
XREF,
XRefKindField, // reference kind
TypeIDField, // type if value, operator kind if operator
BCArray<IdentifierIDField> // access path
BCArray<IdentifierIDField> // extension module name (if extension value)
// base module name
// access path
>;
}