[clang] [ASTWriter] Detect more non-affecting FileIDs to reduce source location duplication (PR #112015)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 05:01:43 PST 2024


================
@@ -43,7 +43,7 @@ module third {}
 // CHECK-NEXT:       "command-line": [
 // CHECK-NEXT:         "-cc1",
 // CHECK:              "-fmodule-map-file=[[PREFIX]]/second/second/module.modulemap"
-// CHECK-NOT:          "-fmodule-map-file=[[PREFIX]]/second/second/sub.modulemap"
+// CHECK-NEXT:         "-fmodule-map-file=[[PREFIX]]/second/second/sub.modulemap"
----------------
ilya-biryukov wrote:

Thanks for pointing this out, I did not realize this was important.

That would require digging into scan-deps a bit, let me try to see if it's possible to match the previous behavior.
In general, I feel that rewriting ModuleDepCollector in a way that walks over the module dependency graph rather than the `InputFile` is probably the right solution in the long run, but I'm not sure if it's an easy change to make. (I still don't have a good grasp on what outputs are generally expected here, relying on something as internal as `InputFile` in the serialized AST was a surprise).

https://github.com/llvm/llvm-project/pull/112015


More information about the cfe-commits mailing list