[PATCH] D44346: [clang-tidy] Add Zircon module to clang-tidy

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 13 13:07:22 PDT 2018

aaron.ballman added inline comments.

Comment at: clang-tidy/tool/ClangTidyMain.cpp:527
-// This anchor is used to force the linker to link the GoogleModule.
+// This anchor is used to force the linker to link the FuchsiaModule.
 extern volatile int FuchsiaModuleAnchorSource;
You can go ahead and commit this change directly to trunk, no need to roll it in to this patch (since it's an unrelated drive-by). No review necessary.

Comment at: clang-tidy/zircon/TemporaryObjectsCheck.cpp:31
+void TemporaryObjectsCheck::registerMatchers(MatchFinder *Finder) {
+  // Matcher for default constructors
+  Finder->addMatcher(
Full stop at the end of comments (here and elsewhere).

Comment at: clang-tidy/zircon/TemporaryObjectsCheck.cpp:51
+         "creating a temporary object of type %0 is prohibited")
+        << D->getConstructor()->getParent()->getQualifiedNameAsString();
You can skip the call to `getQualifiedNameAsString()`; the diagnostics engine will handle it properly.

Comment at: clang-tidy/zircon/TemporaryObjectsCheck.h:21-22
+/// Construction of specific temporary objects in the Zircon kernel is
+/// discouraged. Takes the list of such discouraged temporary objects as a
+/// parameter.
I think the "Takes the list" sentence could be made more clear as "The list of disallowed temporary object types is configurable.", but you could probably just drop the sentence entirely as well.

Comment at: docs/clang-tidy/checks/list.rst:93
+   zircon-temporary-objects
Can you keep this list alphabetical?

Comment at: docs/clang-tidy/index.rst:78
                        relate to any particular coding style.
+``zircon-``            Checks related to Zercon kernel coding conventions.
 ====================== =========================================================


More information about the cfe-commits mailing list