mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add AST pointer to TypeRefinementContext.
Updating r22145, this patch adds pointers from a TypeRefinementContext to the AST node that introduced the context, along with the reason for refinement. This reason supports the scenario where an AST node may introduce multiple refinement contexts (e.g., eventually we want an IfStmt to introduce two refinement contexts, one for the Then branch and one for the Else branch. The patch also fixes a memory leak for the storage holding a refinement context's children. Swift SVN r22232
This commit is contained in:
@@ -1424,7 +1424,7 @@ SourceFile::SourceFile(Module &M, SourceFileKind K,
|
||||
// the source file are guaranteed to be executing on at least the minimum
|
||||
// platform version.
|
||||
auto VersionRange = VersionRange::allGTE(M.Ctx.LangOpts.MinPlatformVersion);
|
||||
TRC = new (M.Ctx) TypeRefinementContext(VersionRange);
|
||||
TRC = TypeRefinementContext::createRoot(M.Ctx, this, VersionRange);
|
||||
}
|
||||
|
||||
SourceFile::~SourceFile() {}
|
||||
|
||||
Reference in New Issue
Block a user