[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2020-02-24 Thread Andi via Phabricator via cfe-commits
Abpostelnicu added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:88 + + if (!Sources.isInMainFile(ND.getBeginLoc())) +return; This breaks the usage of this checker in an unified build scenario since the main file for the

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2020-01-28 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml added a comment. In D52136#1844384 , @grandinj wrote: > Hi > > Thanks a lot for this checker - would it be possible to enhance it to also > update stuff in associated header files? > > Thanks Check out D61989 , Re

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2020-01-28 Thread Noel Grandin via Phabricator via cfe-commits
grandinj added a comment. Herald added a project: LLVM. Hi Thanks a lot for this checker - would it be possible to enhance it to also update stuff in associated header files? Thanks Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D52136/new/ https://reviews.llvm.o

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343000: [clang-tidy] Add modernize-concat-nested-namespaces check (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D5213

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343000: [clang-tidy] Add modernize-concat-nested-namespaces check (authored by JonasToth, committed by ). Repository: rL LLVM https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Commited for you. https://reviews.llvm.org/D52136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml added a comment. Thanks you all for your participation in the review process. I guess it is done now. I don't have write access to the repositories, @aaron.ballman, could you apply the patch on my behalf? Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:3

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 166945. wgml marked 10 inline comments as done. wgml added a comment. Dropped a few consts, updated doc text. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy/moder

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Aside from the local `const` qualification stuff and some minor wordsmithing of the documentation, this LGTM. Comment at: clang-tidy/modernize/ConcatNestedName

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-22 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 166602. wgml marked an inline comment as done. wgml added a comment. Updated signature of `concatNamespaces`. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy/moder

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-22 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml marked 6 inline comments as done. wgml added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:52 +const NamespaceContextVec &Namespaces) { + std::ostringstream Result; + bool First = true; aaron.ballman wrote: > wgml wr

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:31 +static bool singleNamedNamespaceChild(const NamespaceDecl &ND) { + const NamespaceDecl::decl_range Decls = ND.decls(); + if (std::distance(Decls.begin(), Decls.end()) != 1)

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-21 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml marked 2 inline comments as done. wgml added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:52 +const NamespaceContextVec &Namespaces) { + std::ostringstream Result; + bool First = true; aaron.ballman wrote: > Can thi

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-21 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 166529. wgml marked 4 inline comments as done. wgml edited the summary of this revision. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy/modernize/ConcatNestedNamesp

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:52 +const NamespaceContextVec &Namespaces) { + std::ostringstream Result; + bool First = true; Can this be rewritten with `llvm::for_each()` and a `Twine`

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-19 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml marked 2 inline comments as done. wgml added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:102-108 + if (childrenCount(ND.decls()) == 0) { +SourceRange Removal(Namespaces.front().Begin, Namespaces.front().RBrace); + +diag(Namespac

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:102-108 + if (childrenCount(ND.decls()) == 0) { +SourceRange Removal(Namespaces.front().Begin, Namespaces.front().RBrace); + +diag(Namespaces.front().Begin, + "Nested n

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-16 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 165698. wgml added a comment. One last typo. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy/modernize/ConcatNestedNamespacesCheck.h clang-tidy/modernize/Moderni

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-16 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 165677. wgml added a comment. Fixed typo in documentation. Refactored a bit of check code to make it more readable. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml updated this revision to Diff 165658. wgml marked 12 inline comments as done. wgml added a comment. Adjusted to review comments. https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp clang-tidy/modernize/Concat

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:102-108 + if (childrenCount(ND.decls()) == 0) { +SourceRange Removal(Namespaces.front().Begin, Namespaces.front().RBrace); + +diag(Namespaces.front().Begin, + "Nested nam

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:102-108 + if (childrenCount(ND.decls()) == 0) { +SourceRange Removal(Namespaces.front().Begin, Namespaces.front().RBrace); + +diag(Namespaces.front().Begin, + "Nested nam

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:37 +static bool singleNamedNamespaceChild(NamespaceDecl const &ND) { + auto const Decls = ND.decls(); + if (childrenCount(Decls) != 1) Type is not spelled in

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:42-45 + if (Decl->getKind() != Decl::Kind::Namespace) +return false; + + auto const *NS = reinterpret_cast(Decl); Use proper casting, `isa<>()`, `dyn_cast<>`,

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp:73-74 +void ConcatNestedNamespacesCheck::registerMatchers(MatchFinder *Finder) { + if (getLangOpts().CPlusPlus) +Finder->addMatcher(namespaceDecl().bind("namespace"), this); +}

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-15 Thread Wojtek Gumuła via Phabricator via cfe-commits
wgml created this revision. wgml added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: xazax.hun, mgorny. Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`.