[Sema] Generate TRC for unparsed functions right before type-checking

Fix an issue where `if #available(...)` conditions were ignored in
emit-module-separately builds or when skipping non-inlinable function
bodies.

To handle functions for which parsing is delayed but type-checking is
not delayed, move up building the delayed TRC to the
TypeCheckFunctionBodyRequest service.

rdar://83166742
This commit is contained in:
Alexis Laferrière
2021-09-15 16:03:36 -07:00
parent 2cd0d5e1d3
commit c8104aab38
5 changed files with 18 additions and 5 deletions

View File

@@ -2892,7 +2892,7 @@ SynthesizedFileUnit &SourceFile::getOrCreateSynthesizedFile() {
return *SynthesizedFile;
}
TypeRefinementContext *SourceFile::getTypeRefinementContext() {
TypeRefinementContext *SourceFile::getTypeRefinementContext() const {
return TRC;
}