================
@@ -728,11 +728,20 @@ bool isPreambleCompatible(const PreambleData &Preamble,
auto Bounds = computePreambleBounds(CI.getLangOpts(), *ContentsBuffer,
Inputs.Opts.SkipPreambleBuild);
auto VFS = Inputs.TFS->view(Inputs.CompileCommand.Directory);
+ auto RequiredModulesMatch = [&]() -> bool {
+ if (!Inputs.ModulesManager || !Preamble.RequiredModules)
+ return true;
+ auto NewNames = Inputs.ModulesManager->getRequiredModuleNames(FileName);
+ llvm::StringSet<> NewNameSet;
+ NewNameSet.insert_range(NewNames);
+ return NewNameSet == Preamble.RequiredModules->getRequiredModuleNames();
+ };
----------------
ChuanqiXu9 wrote:
We need to add a comment to explain why do we need this here. Because
`Preamble.RequiredModules->canReuse` only checks if the previously built module
files are up to date or not. But if we introduce a new import, it can't detect
it.
https://github.com/llvm/llvm-project/pull/199460
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits