Skip to content

Commit f7d10b8

Browse files
committed
[ClangImporter] Move incremental processing to the new language option
`IncrementalProcessing` is now a language option `IncrementalExtensions`, which also means it is now part of the module hash. When compiling a clang module, the output file path would be generated in the `BeginSourceFile` prior to `enableIncrementalProcessing` being called on the preprocessor. The hash would then be generated again when compiling the module (after the `enableIncrementalProcessing` call) and included in the PCM, leading to a mismatch between the path and the hash in the module. This could be fixed by moving `enableIncrementalProcessing` above `BeginSourceFile`, but now that it's an option we can instead just add it to the invocation arguments. Resolves rdar://112993659.
1 parent e24988e commit f7d10b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ importer::getNormalInvocationArguments(
728728
}
729729
}
730730
}
731+
732+
invocationArgStrs.push_back("-Xclang");
733+
invocationArgStrs.push_back("-fincremental-extensions");
731734
}
732735

733736
static void
@@ -1346,7 +1349,6 @@ ClangImporter::create(ASTContext &ctx,
13461349
return nullptr; // there was an error related to the compiler arguments.
13471350

13481351
clang::Preprocessor &clangPP = instance.getPreprocessor();
1349-
clangPP.enableIncrementalProcessing();
13501352

13511353
// Setup Preprocessor callbacks before initialing the parser to make sure
13521354
// we catch implicit includes.

0 commit comments

Comments
 (0)