MaskRay wrote:
```
The possible bases
┌─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────┬───────────────────────┬──────────────────────┬─────────────────────────────────────────────────────────────────┐
│ Base for a relative directory │
Symlink at repo root (your workflow) │ File copied elsewhere │
Whole checkout moved │ Generator knows the base when writing?
│
├─────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────┼───────────────────────┼──────────────────────┼─────────────────────────────────────────────────────────────────┤
│ A. Path the file was opened through (this branch) │ Resolves to repo
root, which is wrong for a build-dir database │ Meaning changes │ Works
│ No │
├─────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────┼───────────────────────┼──────────────────────┼─────────────────────────────────────────────────────────────────┤
│ B. Real location of the file (symlinks followed) │ Resolves to build/,
which is right │ Meaning changes │ Works
│ Yes │
├─────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────┼───────────────────────┼──────────────────────┼─────────────────────────────────────────────────────────────────┤
│ C. Tool's current directory (what ClangTool does today) │ Depends on how the
tool was launched │ Same │ Same
│ No │
├─────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────┼───────────────────────┼──────────────────────┼─────────────────────────────────────────────────────────────────┤
│ D. Workspace/project root (what ccls does) │ Repo root
│ Works │ Works
│ Only if it assumes the root; libTooling has no notion of a root │
└─────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┴───────────────────────┴──────────────────────┴─────────────────────────────────────────────────────────────────┘
```
This PR implements A, which I think is not ideal.
https://github.com/llvm/llvm-project/pull/69856
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits