Author: Kirill Bobyrev Date: 2021-10-27T13:53:30+02:00 New Revision: 6edc50971953775ab32d2bf298b4c991e8961055
URL: https://github.com/llvm/llvm-project/commit/6edc50971953775ab32d2bf298b4c991e8961055 DIFF: https://github.com/llvm/llvm-project/commit/6edc50971953775ab32d2bf298b4c991e8961055.diff LOG: [clangd] NFC: Remove single-line braces in IncludeCleaner Added: Modified: clang-tools-extra/clangd/IncludeCleaner.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp index cc69fdaa5e41..b1d0f956157f 100644 --- a/clang-tools-extra/clangd/IncludeCleaner.cpp +++ b/clang-tools-extra/clangd/IncludeCleaner.cpp @@ -81,16 +81,14 @@ class ReferencedLocationCrawler } bool TraverseType(QualType T) { - if (isNew(T.getTypePtrOrNull())) { // don't care about quals + if (isNew(T.getTypePtrOrNull())) // don't care about quals Base::TraverseType(T); - } return true; } bool VisitUsingDecl(UsingDecl *D) { - for (const auto *Shadow : D->shadows()) { + for (const auto *Shadow : D->shadows()) add(Shadow->getTargetDecl()); - } return true; } @@ -107,12 +105,10 @@ class ReferencedLocationCrawler using Base = RecursiveASTVisitor<ReferencedLocationCrawler>; void add(const Decl *D) { - if (!D || !isNew(D->getCanonicalDecl())) { + if (!D || !isNew(D->getCanonicalDecl())) return; - } - for (const Decl *Redecl : D->redecls()) { + for (const Decl *Redecl : D->redecls()) Result.insert(Redecl->getLocation()); - } } bool isNew(const void *P) { return P && Visited.insert(P).second; } @@ -243,9 +239,8 @@ getUnused(const IncludeStructure &Structure, continue; } auto IncludeID = static_cast<IncludeStructure::HeaderID>(*MFI.HeaderID); - if (!ReferencedFiles.contains(IncludeID)) { + if (!ReferencedFiles.contains(IncludeID)) Unused.push_back(&MFI); - } dlog("{0} is {1}", MFI.Written, ReferencedFiles.contains(IncludeID) ? "USED" : "UNUSED"); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits