[PATCH] D138797: [include-cleaner] Implement IWYU begin_keep/end_keep pragma support.

Viktoriia Bakalova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 05:47:39 PST 2022


VitaNuo added inline comments.


================
Comment at: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp:312
+
+  size_t offsetToLineNum(llvm::Annotations MainFile, size_t Offset) {
+    int Count = MainFile.code().substr(0, Offset).count('\n');
----------------
hokein wrote:
> this is only used in `IWYUKeep` test, I'd make it as a local lambda (with MainFile captured) in the test:
> 
> ```
> auto OffsetToLineNum = [&MainFile](size_t Offset) { ... };
> ``` 
Nice idea, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138797



More information about the cfe-commits mailing list