ilya-biryukov wrote:

> Did you mean _"mark it as affecting"_ / _"not mark it as **non**-affecting"_ 
> instead of _"**not** mark it as affecting"_?

Yes, sorry, that was a mistake on my part.

> Can you expand on that? Why doesn't it work properly if you stop writing 
> those input files as well?

Because `ClangScanDeps` relies on the information from those `InputFIle` to 
determine which module map files the code depends on, the relevant code is 
here: 
https://github.com/llvm/llvm-project/blob/a15bf88d532ad2e81d7c54c480707f6c7d8bbeab/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp#L599

If we stop producing those input files, it should not affect the compiler in 
any way, but clang-scan-deps will be broken (some tests will fail, including 
the ones that check the final commands can compile the underlying modules)

> This is unexpected and I think it breaks the correctness of clang-scan-deps. 
> I think we might need to take your patch a bit further and make it so that 
> `ASTWriter::WriteInputFiles()` doesn't care whether the SLocEntry associated 
> with the file through `Module::DefinitionLoc` is loaded or local.

Hm, that would actually make the final outputs much more predictable, so I like 
this approach. Let me try to prototype it and get back to you.
The only downside is more `InputFile` entries being reported, but I bet they 
are a very small fraction of the serialized AST, so it should not really 
matter. 

https://github.com/llvm/llvm-project/pull/112015
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to