mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Introduce ModuleID, with codes for special modules.
ModuleID is compatible with IdentifierID, but uses 0 to mean “the builtin module” and 1 to mean “the current module”. Anything else is a top-level module name, as an identifier. As an implementation detail, 1 is now never a valid IdentifierID. (0 remains “the empty string”.) Using this, simplify the encoding of the owner of a conformance. Swift SVN r9944
This commit is contained in:
@@ -370,10 +370,13 @@ public:
|
||||
Optional<DeclContext *> ForcedContext = {},
|
||||
std::function<void(Decl*)> DidRecord = nullptr);
|
||||
|
||||
/// Returns the appropriate module for the given ID.
|
||||
Module *getModule(serialization::ModuleID MID);
|
||||
|
||||
/// Returns the appropriate module for the given name.
|
||||
///
|
||||
/// If the name matches the name of the current module, a shadowed module
|
||||
/// is loaded instead. An empty name represents the Builtin module.
|
||||
/// is loaded instead.
|
||||
Module *getModule(Identifier name);
|
||||
|
||||
/// Reads a substitution record from \c DeclTypeCursor.
|
||||
|
||||
Reference in New Issue
Block a user