[PATCH] D53400: [clangd] Remove the overflow log.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 19 01:15:06 PDT 2018


hokein added inline comments.


================
Comment at: clangd/XRefs.cpp:43
+  if (Line >= SymbolLocation::Position::MaxLine)
+    log("Get an overflowed line");
+  return Line;
----------------
sammccall wrote:
> Log message could use more context. And I think it'd be really useful to print the whole location here.
> 
> bikeshed: you could add a method `bool Position::hasOverflow()`, and then write below
> 
> ```
> if (LSPLoc.range.start.hasOverflow() || LSPLoc.range.end.hasOverflow())
>   log("Possible overflow in symbol location: {0}", LSPLoc);
> ```
> 
> Distinguishing between line/column overflow isn't important if you're printing the full range anyway.
This is neat. 


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53400





More information about the cfe-commits mailing list