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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 18 08:38:07 PDT 2018


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Some nitty ideas about the log message, but whatever you think is best.



================
Comment at: clangd/XRefs.cpp:43
+  if (Line >= SymbolLocation::Position::MaxLine)
+    log("Get an overflowed line");
+  return Line;
----------------
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.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53400





More information about the cfe-commits mailing list