File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1153,10 +1153,10 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
1153
1153
opts |= SourceFile::ParsingFlags::DisableDelayedBodies;
1154
1154
}
1155
1155
1156
+ auto typeOpts = getASTContext ().TypeCheckerOpts ;
1156
1157
if (forPrimary || isWholeModuleCompilation ()) {
1157
1158
// Disable delayed body parsing for primaries and in WMO, unless
1158
1159
// forcefully skipping function bodies
1159
- auto typeOpts = getASTContext ().TypeCheckerOpts ;
1160
1160
if (typeOpts.SkipFunctionBodies == FunctionBodySkipping::None)
1161
1161
opts |= SourceFile::ParsingFlags::DisableDelayedBodies;
1162
1162
} else {
@@ -1165,9 +1165,10 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
1165
1165
opts |= SourceFile::ParsingFlags::SuppressWarnings;
1166
1166
}
1167
1167
1168
- // Enable interface hash computation for primaries, but not in WMO, as it's
1169
- // only currently needed for incremental mode.
1170
- if (forPrimary) {
1168
+ // Enable interface hash computation for primaries or emit-module-separately,
1169
+ // but not in WMO, as it's only currently needed for incremental mode.
1170
+ if (forPrimary ||
1171
+ typeOpts.SkipFunctionBodies == FunctionBodySkipping::NonInlinableWithoutTypes) {
1171
1172
opts |= SourceFile::ParsingFlags::EnableInterfaceHash;
1172
1173
}
1173
1174
return opts;
Original file line number Diff line number Diff line change 4
4
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift 2> %t/b.hash
5
5
// RUN: not cmp %t/a.hash %t/b.hash
6
6
7
+ /// We should generate an interface hash for emit-module-separately jobs even
8
+ /// with no primaries.
9
+ // RUN: %target-swift-frontend -dump-interface-hash %t/b.swift -experimental-skip-non-inlinable-function-bodies-without-types 2> %t/b-emit-module.hash
10
+ // RUN: cmp %t/b.hash %t/b-emit-module.hash
11
+
7
12
// BEGIN a.swift
8
13
func f( ) { }
9
14
You can’t perform that action at this time.
0 commit comments