ArcsinX added inline comments.

================
Comment at: clang/lib/Tooling/Syntax/Tokens.cpp:252
     return {};
-  assert(Spelled.front().location().isFileID());
-
-  auto FID = sourceManager().getFileID(Spelled.front().location());
-  auto It = Files.find(FID);
-  assert(It != Files.end());
-
-  const MarkedFile &File = It->second;
+  const MarkedFile &File = fileForSpelled(Spelled);
   // `Spelled` must be a subrange of `File.SpelledTokens`.
----------------
Could we use `const auto &` here as in lines 419, 434 for consistency?


================
Comment at: clang/lib/Tooling/Syntax/Tokens.cpp:431
+std::vector<TokenBuffer::Expansion>
+TokenBuffer::expansionsAffecting(llvm::ArrayRef<syntax::Token> Spelled) const {
+  if (Spelled.empty())
----------------
Will it be useful to have similar API with FileID/MarkedFile parameter?
For example, we already have FileID in `SelectionTester::SelectionTester`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84009



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

Reply via email to