[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-06 Thread Paula Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG00a57558978d: [clang-tidy] Add check llvmlibc-implementation-in-namespace. (authored by PaulkaToast). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-06 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. LGTM! Comment at: clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp:21 + Finder->addMatcher( + decl(hasParent(translationUnitDecl(

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-06 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast added inline comments. Comment at: clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp:21 + Finder->addMatcher( + decl(hasParent(translationUnitDecl()), unless(linkageSpecDecl())) + .bind("child_of_translation_unit"), -

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-06 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast updated this revision to Diff 255277. PaulkaToast marked 13 inline comments as done. PaulkaToast added a comment. Addressed njames's and aaron's comments. (: Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new/ https://reviews.llvm.

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp:21 + Finder->addMatcher( + decl(hasParent(translationUnitDecl()), unless(linkageSpecDecl())) + .bind("child_of_translation_unit"), ---

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-02 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. This check needs a store Options override method as it reading options from a configuration. Check other checks to see how this is done. Comment at: clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.h:35 +private: + std::string Re

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-04-01 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast updated this revision to Diff 254376. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new/ https://reviews.llvm.org/D76818 Files: clang-tools-extra/clang-tidy/llvmlibc/CMakeLists.txt clang-tools-extra/clang-tidy/llvmlibc/Implemen

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-31 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/llvmlibc-implementation-in-namespace.cpp:16 + +namespace namespaceG { +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: '__llvm_libc' needs to be the outermost namespace. Can

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-31 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast added a comment. Friendly Ping @njames93 (: Any other changes needed? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new/ https://reviews.llvm.org/D76818 ___ cfe-commits mailing list c

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-27 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast marked 3 inline comments as done. PaulkaToast added a comment. In D76818#1943781 , @njames93 wrote: > If you want to make it a general check, you should consider making the > default module options set the correct namespace > RequiredNamespace

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-27 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast updated this revision to Diff 253250. PaulkaToast added a comment. Updated to handle nested namespaces, exclude C linkages functions, and made check language specific. (: Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new/ https:

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-26 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. If you want to make it a general check, you should consider making the default module options set the correct namespace RequiredNamespace ClangTidyOptions getModuleOptions() override { ClangTidyOptions Options; Options.CheckOptions["llvmlibc-implementation-in

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-25 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/llvmlibc-implementation-in-namespace.cpp:30 +// Wrapped in correct namespace. +namespace __llvm_libc { +class ClassB; For completeness, can you include a nested namespace a

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-25 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please also add isLanguageVersionSupported(), because namespaces make sense only in C++. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76818/new/ https://reviews.llvm.org/D76818 __

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-25 Thread Paula Toth via Phabricator via cfe-commits
PaulkaToast created this revision. PaulkaToast added reviewers: alexfh, aaron.ballman, hokein, njames93. PaulkaToast added a project: clang-tools-extra. Herald added subscribers: cfe-commits, MaskRay, xazax.hun, mgorny. Herald added a project: clang. This check makes sure all llvm-libc implementat