Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp | ||
---|---|---|
123 | let's use HS->getModuleMap().getBuiltinDir() then we can get away with just comparing that pointer to H.physical()->getLastRef().getDir() (same applies to all the other places as well) | |
clang-tools-extra/clangd/IncludeCleaner.cpp | ||
314 | let's move this into mayConsiderUnused, we also convert this include into a FileEntry in there, so we can directly compare the directory agian. | |
clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp | ||
579–580 | can you rather include these as <amintrin.h> | |
587–588 | we should put these under resources/include/xxxx.h |
Thanks for the comments!
clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp | ||
---|---|---|
123 | This only works in clangd code for me. I get nullptr for HS->getModuleMap().getBuiltinDir() in other places (Clang Tidy check and the library). | |
clang-tools-extra/clangd/IncludeCleaner.cpp | ||
314 | Ok moved to mayConsiderUnused and using the file entry now, but see above regarding comparing the directories. |
clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp | ||
---|---|---|
123 | hmm that's probably because you're not setting up the include structure correctly. resource-dir isn't the builtindir, it's resource-dir + "/include" (the comments i had in the clangd unittests applies in a similar manner to other tests as well). |
Fix analysis test to properly recognize the resource directory.
Use HeaderSearch->getModuleMap().BuiltinDir to find out the resource directory.
thanks!
clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp | ||
---|---|---|
587 | nit: also wrap contents in guard() here to make sure we're not testing multiple things here (i.e. behavior for non-self-contained headers) | |
clang-tools-extra/include-cleaner/lib/Analysis.cpp | ||
100 | now we're not going to put matching includes into the Used set. i know we're going to filter them put from the final output in the next loop, but still better to keep normal track of Used i believe | |
clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp | ||
286 | again lets make this self-contained |
let's use HS->getModuleMap().getBuiltinDir() then we can get away with just comparing that pointer to H.physical()->getLastRef().getDir() (same applies to all the other places as well)