aaron.ballman added inline comments.

================
Comment at: clang/lib/Basic/SourceManager.cpp:882-884
     const SrcMgr::SLocEntry &E = getLoadedSLocEntry(I);
+    if (E.getOffset() == 0)
+      return FileID(); // invalid entry.
----------------
This looks incorrect to me -- I don't think an offset of `0` is invalid. I 
think a better way to do this is:
```
bool Invalid;
const SrcMgr::SLocEntry &E = getLoadedSLocEntry(I, &Invalid);
if (Invalid)
  return FileID(); // Invalid entry.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130847

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

Reply via email to