Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
FWIW, details of pragma are explained in https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-always_keep
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Record.h | ||
---|---|---|
63 | Why wouldn't you actually inline the implementation for both these functions? The implementations seem trivial enough. | |
clang-tools-extra/include-cleaner/lib/Record.cpp | ||
38 | I don't think you've added a dependency on all these headers in this patch. Nice if you've actually fixed the missing include violations all over the file, but please double-check that there are no debugging etc. artefacts left. | |
277 | I believe you need to check FE for nullptr, similar to private pragma handling above. | |
277 | You might want to inline this call, it seems to have a single usage right below. | |
427 | As mentioned above, consider inlining. |
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Record.h | ||
---|---|---|
63 | most of the binaries are build with LTO nowadays, so inlining code into headers doesn't really gain much from performance perspective. moreover, these are not really hot functions, they're invoked once per #include directive inside the main file, at the end of analysis. OTOH, when they're inlined and there needs to be a change to these function definitions, it requires all the translation units depending on this header to be recompiled. Hence I think having them in the cpp file is a not benefit for development cycles. | |
clang-tools-extra/include-cleaner/lib/Record.cpp | ||
38 | yes these are all fixes generated by include-cleaner, I don't have any unused include findings. | |
277 | do you mean initializer for CommentFID? if so CommentFID is actually used in more places below | |
277 | thanks missed that. unified all the usages for getUniqueID, they all should be the same. you're absolutely right about checking for FE, in practice it's almost never null as it's the file in which we've found the IWYU pragma. But SourceManager actually allows working with virtual files, in which case there might not be a phyiscal file entry. for now not adding support to always_keep and private pragmas for virtual files, as it requires deeper changes in the way we store uniqueids (we can no longer depend on them) and they're not common in practice (usually those virtual files are provided as predefines from the compiler and they likely won't contain IWYU pragmas). |
Why wouldn't you actually inline the implementation for both these functions? The implementations seem trivial enough.