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 @@ -1156,10 +1156,10 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
1156
1156
opts |= SourceFile::ParsingFlags::DisableDelayedBodies;
1157
1157
}
1158
1158
1159
+ auto typeOpts = getASTContext ().TypeCheckerOpts ;
1159
1160
if (forPrimary || isWholeModuleCompilation ()) {
1160
1161
// Disable delayed body parsing for primaries and in WMO, unless
1161
1162
// forcefully skipping function bodies
1162
- auto typeOpts = getASTContext ().TypeCheckerOpts ;
1163
1163
if (typeOpts.SkipFunctionBodies == FunctionBodySkipping::None)
1164
1164
opts |= SourceFile::ParsingFlags::DisableDelayedBodies;
1165
1165
} else {
@@ -1168,9 +1168,10 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
1168
1168
opts |= SourceFile::ParsingFlags::SuppressWarnings;
1169
1169
}
1170
1170
1171
- // Enable interface hash computation for primaries, but not in WMO, as it's
1172
- // only currently needed for incremental mode.
1173
- if (forPrimary) {
1171
+ // Enable interface hash computation for primaries or emit-module-separately,
1172
+ // but not in WMO, as it's only currently needed for incremental mode.
1173
+ if (forPrimary ||
1174
+ typeOpts.SkipFunctionBodies == FunctionBodySkipping::NonInlinableWithoutTypes) {
1174
1175
opts |= SourceFile::ParsingFlags::EnableInterfaceHash;
1175
1176
}
1176
1177
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