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