SIL: always update the linkage of a function with the serialized linkage in the swiftmodule.

The cross-module-optimization can change the linkage of a function to public. Then the SILLinkage is "out of sync" with the linkage derived from the AST. We need to make sure to read the correct SILLinkage from the module file.
This commit is contained in:
Erik Eckstein
2019-12-03 21:00:03 +01:00
parent 210fabb567
commit 8bc5daca77
7 changed files with 41 additions and 14 deletions

View File

@@ -526,6 +526,13 @@ public:
/// succeeded, false otherwise.
bool loadFunction(SILFunction *F);
/// Update the linkage of the SILFunction with the linkage of the serialized
/// function.
///
/// The serialized SILLinkage can differ from the linkage derived from the
/// AST, e.g. cross-module-optimization can change the SIL linkages.
void updateFunctionLinkage(SILFunction *F);
/// Attempt to link the SILFunction. Returns true if linking succeeded, false
/// otherwise.
///