[PATCH] D35372: [clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module.

Yan Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 3 10:27:15 PDT 2017


yawanng added inline comments.


================
Comment at: clang-tidy/android/CloexecCheck.h:35
+
+  // This issue has three types.
+  // Type1 is to insert the necessary macro flag in the flag argument.
----------------
hokein wrote:
> It is unclear to me what the "issue" means here? I assume there are three types of fixes?
Yes. It means three types of fixes :-)


================
Comment at: clang-tidy/android/CloexecCheck.h:36
+  // This issue has three types.
+  // Type1 is to insert the necessary macro flag in the flag argument.
+  void
----------------
hokein wrote:
> Deserve a document on the behavior of the method, would be better to give an example. The same below.
> 
> Is `Flag` required to be a macro flag? looks like it could be any string.
Yes, the flag is expected to be a string of the required macro name.



================
Comment at: clang-tidy/android/CloexecCheck.h:75
+  inline ast_matchers::internal::Matcher<FunctionDecl>
+  hasSockAddrPointerTypeParameter(int n) {
+    return ast_matchers::hasParameter(
----------------
hokein wrote:
> should we put this method and below in the base class? They seem to be check-specific, I think? 
Only the 'mode_t' one is currently only used by one check. The reason for putting them all together here is to be kind of uniform and maybe facilitate possible future checks that may contain this type.


https://reviews.llvm.org/D35372





More information about the cfe-commits mailing list