[PATCH] D137697: Move the isSelfContained function from clangd to libtooling.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 04:22:31 PST 2022


sammccall added inline comments.


================
Comment at: clang/lib/Tooling/Inclusions/Header.cpp:64
+  // particular preprocessor state, usually set up by another header.
+  return !isDontIncludeMeHeader(SM.getBufferData(SM.translateFile(FE)));
+}
----------------
kadircet wrote:
> `translateFile` actually does a linear scan over all the slocentries, so i think it's better for this API to be based on FileID. (later on we can easily get fileentry from fileid in constant time)
You can get content through the fileentry directly, no?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137697



More information about the cfe-commits mailing list