mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Fix a recursive-dependency bug caught by previous commit.
Constructors have their "implicit this" VarDecl specified at creation, but the context for said VarDecl is the constructor itself. Add a new flag to allow the deserialization of a VarDecl without setting a DeclContext. Swift SVN r5747
This commit is contained in:
@@ -125,8 +125,18 @@ class ModuleFile {
|
||||
/// Returns the decl context with the given ID, deserializing it if needed.
|
||||
DeclContext *getDeclContext(serialization::DeclID DID);
|
||||
|
||||
/// Controls how a Decl is deserialized.
|
||||
enum DeclDeserializationOptions {
|
||||
/// Don't set the decl's context. It will be set by the caller instead.
|
||||
///
|
||||
/// This is useful for declarations that reference each other at
|
||||
/// construction time.
|
||||
SkipContext = 0x1
|
||||
};
|
||||
|
||||
/// Returns the decl with the given ID, deserializing it if needed.
|
||||
Decl *getDecl(serialization::DeclID DID);
|
||||
Decl *getDecl(serialization::DeclID DID,
|
||||
DeclDeserializationOptions opts = {});
|
||||
|
||||
/// Returns the type with the given ID, deserializing it if needed.
|
||||
Type getType(serialization::TypeID TID);
|
||||
|
||||
Reference in New Issue
Block a user