I believe the way LLVM bytecode/IR is emitted is not optimal:
!2862 = !DIFile(filename: "Bundle.zig", directory: "/home/wzk/zig/lib/std/crypto/Certificate")
For most tools it doesn't matter but for some tools like llvm opt, only the filename is emitted in "--pass-remarks".
This means it's complicated for tools to interpret the optimization remarks.
I've modified getDebugFile to not call toAbsolute and instead respect the root / subpath split already present in Compilation.Path
When there is no root, I interpret the subpath relatively to cwd.
This generates the file information I want:
!DIFile(filename: "std/crypto/Certificate/Bundle.zig", directory: "/home/wzk/zig/lib/")
Discussed this with @andrewk and @mlugg https://zsf.zulipchat.com/#narrow/channel/454360-compiler/topic/file.20location.20lost.20in.20LLVM.20translation/with/593290876
Note: the import changes is just what ZLS with default import sort gives, I can revert if anyone care.
I believe the way LLVM bytecode/IR is emitted is not optimal:
```
!2862 = !DIFile(filename: "Bundle.zig", directory: "/home/wzk/zig/lib/std/crypto/Certificate")
```
For most tools it doesn't matter but for some tools like llvm opt, only the filename is emitted in "--pass-remarks".
This means it's complicated for tools to interpret the optimization remarks.
I've modified `getDebugFile` to not call `toAbsolute` and instead respect the root / subpath split already present in `Compilation.Path`
When there is no root, I interpret the subpath relatively to cwd.
This generates the file information I want:
```
!DIFile(filename: "std/crypto/Certificate/Bundle.zig", directory: "/home/wzk/zig/lib/")
```
Discussed this with @andrewk and @mlugg https://zsf.zulipchat.com/#narrow/channel/454360-compiler/topic/file.20location.20lost.20in.20LLVM.20translation/with/593290876
Note: the import changes is just what ZLS with default import sort gives, I can revert if anyone care.