[PATCH] D137751: Produce a more informative diagnostics when Clang runs out of source locations

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 21:05:11 PST 2022


shafik added inline comments.


================
Comment at: clang/lib/Basic/SourceManager.cpp:2251
+  uint64_t CountedSize = 0;
+  for (int IDIndex = -(int)LoadedSLocEntryTable.size() - 1;
+       IDIndex < (int)LocalSLocEntryTable.size(); ++IDIndex) {
----------------
alexfh wrote:
> Could you add a comment about the meaning of negative IDIndex values?
Maybe make `-(int)LoadedSLocEntryTable.size()` a named variable may help readability as well.  Perhaps also for `(int)LocalSLocEntryTable.size()` as well.


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

https://reviews.llvm.org/D137751



More information about the cfe-commits mailing list