ilya-biryukov added inline comments.

================
Comment at: clangd/ClangdUnit.cpp:256
+// directive inside main file.
+// If a header is transitively included in multiple direct includes of main, we
+// choose the first one.
----------------
We should find a way to point into an exact `include` directive (source 
locations have this information).



================
Comment at: clangd/ClangdUnit.cpp:406
+  for (const Diag &D : ASTDiags.take()) {
+    if (!mentionsMainFile(D) && Opts.LimitDiagsOutsideMainFile &&
+        ++DiagsOutsideMainFile > *Opts.LimitDiagsOutsideMainFile)
----------------
Could we limit per-include-directive instead?
The limit to avoid creating too verbose error messages, rather than reporting 
too many messages, right?


================
Comment at: clangd/ClangdUnit.cpp:438
+      D.File = MainInput.getFile();
+      D.Message = "Error in header: " + D.Message;
+    }
----------------
We should provide the include stack, similar to how compiler does it.
Otherwise it would be really hard to figure out the exact problem the 
diagnostic is pointing at.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D59302



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

Reply via email to