hokein added a comment.

Discussed it offline, technically taking the main file directory into account 
when shorten the #include path would not break the compiler, but it may 
introduce issues violating the code style -- in clangd codebase, we prefer to 
use "#include "<subdir_under_clangd>/header.h" style, e.g. 
`index/background.cc` uses `#include "index/Background.h"`, with this patch we 
will  shorten the include as `#include "background.h"`, so we don't count the 
the `index/background.h` as included (a new `#include "background.h"` will be 
inserted).

One possible solution is that we could use the main file directory as a last 
fallback (if we are not able to shorten the #included path using any 
search-header directories, we try to use the main-file directory).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63295/new/

https://reviews.llvm.org/D63295



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to