[PATCH] D35362: [clang-tidy] Add a close-on-exec check on accept() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110758. https://reviews.llvm.org/D35362 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecAcceptCheck.cpp clang-tidy/android/CloexecAcceptCheck.h docs/ReleaseNotes.rst

[PATCH] D35363: [clang-tidy] Add a close-on-exec check on accept4() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110755. https://reviews.llvm.org/D35363 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecAccept4Check.cpp clang-tidy/android/CloexecAccept4Check.h docs/ReleaseNotes.rst

[PATCH] D35364: [clang-tidy] Add a close-on-exec check on dup() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: clang-tidy/android/CloexecCheck.h:91 + /// Helper function to get the spelling of a particular argument. + StringRef getSpellingArg(const ast_matchers::MatchFinder::MatchResult , + int N) const;

[PATCH] D35364: [clang-tidy] Add a close-on-exec check on dup() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110753. yawanng marked an inline comment as done. https://reviews.llvm.org/D35364 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

[PATCH] D35365: [clang-tidy] Add a close-on-exec check on epoll_create1() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110752. https://reviews.llvm.org/D35365 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecEpollCreate1Check.cpp clang-tidy/android/CloexecEpollCreate1Check.h docs/ReleaseNotes.rst

[PATCH] D35368: [clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110750. yawanng marked 2 inline comments as done. https://reviews.llvm.org/D35368 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecInotifyInit1Check.cpp

[PATCH] D35367: [clang-tidy] Add a close-on-exec check on epoll_create() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110751. https://reviews.llvm.org/D35367 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecEpollCreateCheck.cpp clang-tidy/android/CloexecEpollCreateCheck.h docs/ReleaseNotes.rst

[PATCH] D35370: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.

2017-08-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110749. yawanng marked an inline comment as done. https://reviews.llvm.org/D35370 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecInotifyInitCheck.cpp

[PATCH] D35362: [clang-tidy] Add a close-on-exec check on accept() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110659. https://reviews.llvm.org/D35362 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecAcceptCheck.cpp clang-tidy/android/CloexecAcceptCheck.h docs/ReleaseNotes.rst

[PATCH] D35363: [clang-tidy] Add a close-on-exec check on accept4() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110655. https://reviews.llvm.org/D35363 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecAccept4Check.cpp clang-tidy/android/CloexecAccept4Check.h docs/ReleaseNotes.rst

[PATCH] D35364: [clang-tidy] Add a close-on-exec check on dup() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110654. https://reviews.llvm.org/D35364 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h clang-tidy/android/CloexecDupCheck.cpp

[PATCH] D35365: [clang-tidy] Add a close-on-exec check on epoll_create1() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110652. https://reviews.llvm.org/D35365 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecEpollCreate1Check.cpp clang-tidy/android/CloexecEpollCreate1Check.h docs/ReleaseNotes.rst

[PATCH] D35367: [clang-tidy] Add a close-on-exec check on epoll_create() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110650. https://reviews.llvm.org/D35367 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecEpollCreateCheck.cpp clang-tidy/android/CloexecEpollCreateCheck.h docs/ReleaseNotes.rst

[PATCH] D35368: [clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110649. https://reviews.llvm.org/D35368 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecInotifyInit1Check.cpp clang-tidy/android/CloexecInotifyInit1Check.h docs/ReleaseNotes.rst

[PATCH] D35370: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110646. https://reviews.llvm.org/D35370 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecInotifyInitCheck.cpp clang-tidy/android/CloexecInotifyInitCheck.h docs/ReleaseNotes.rst

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

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. https://reviews.llvm.org/rL310669 is the latest and complete version. It fixes an issue in windows platform. https://reviews.llvm.org/D35372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D35743: [clang-format] Handle Structured binding declaration in C++17

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110640. yawanng added a comment. Show full context. https://reviews.llvm.org/D35743 Files: lib/Format/TokenAnnotator.cpp lib/Format/UnwrappedLineParser.cpp lib/Format/UnwrappedLineParser.h unittests/Format/FormatTest.cpp Index:

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

2017-08-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110606. yawanng marked 3 inline comments as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

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

2017-08-09 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110443. yawanng marked 5 inline comments as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

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

2017-08-07 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D35372#834238, @hokein wrote: > Looks good to me, a few nits. Thanks for improving it continuously. > > I'd hold it for a while to see whether @alexfh has further comments before > submitting it. Thank you for the reviewing :-)

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

2017-08-07 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 110065. yawanng marked 4 inline comments as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

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

2017-08-04 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: clang-tidy/android/CloexecCheck.h:72 + StringRef getSpellingArg(const ast_matchers::MatchFinder::MatchResult , + int n); + hokein wrote: > `n` should be capital `N`. I think we can make it a

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

2017-08-04 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 109778. yawanng marked 13 inline comments as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

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

2017-08-03 Thread Yan Wang via Phabricator via cfe-commits
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

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

2017-08-03 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 109589. yawanng marked 9 inline comments as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecCheck.cpp clang-tidy/android/CloexecCheck.h

[PATCH] D35743: [clang-format] Handle Structured binding declaration in C++17

2017-08-01 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 109222. yawanng added a comment. Move tests to unitest and fix a bug. https://reviews.llvm.org/D35743 Files: lib/Format/TokenAnnotator.cpp lib/Format/UnwrappedLineParser.cpp lib/Format/UnwrappedLineParser.h unittests/Format/FormatTest.cpp Index:

[PATCH] D35743: [clang-format] Handle Structured binding declaration in C++17

2017-07-31 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. Ping. https://reviews.llvm.org/D35743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-07-31 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. Ping. https://reviews.llvm.org/D35372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-28 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108665. yawanng marked 3 inline comments as done. https://reviews.llvm.org/D34114 Files: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/warn-padded-packed.cpp Index: test/CodeGenCXX/warn-padded-packed.cpp

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-27 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108555. yawanng marked an inline comment as done. yawanng edited the summary of this revision. yawanng added a comment. Add more tests and restrict the conditions. https://reviews.llvm.org/D34114 Files: lib/AST/RecordLayoutBuilder.cpp

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-27 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108513. yawanng marked 2 inline comments as done. yawanng edited the summary of this revision. https://reviews.llvm.org/D34114 Files: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/warn-padded-packed.cpp Index: test/CodeGenCXX/warn-padded-packed.cpp

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108401. yawanng added a comment. Add more tests. https://reviews.llvm.org/D34114 Files: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/warn-padded-packed.cpp Index: test/CodeGenCXX/warn-padded-packed.cpp

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108397. https://reviews.llvm.org/D34114 Files: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/warn-padded-packed.cpp Index: test/CodeGenCXX/warn-padded-packed.cpp === ---

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108395. yawanng edited the summary of this revision. yawanng added a comment. Including cases '__attribute__((packed, aligned(X)));'. When the alignment before packing is less or equal to the packed one, he 'packed' attribute not including 'aligned(X)'

[PATCH] D34114: [clang] Change the condition of unnecessary packed warning

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: lib/AST/RecordLayoutBuilder.cpp:1888 -if (Packed && UnpackedAlignment > CharUnits::One() && -getSize() == UnpackedSize) Diag(D->getLocation(), diag::warn_unnecessary_packed) chh wrote: > Why not

[PATCH] D34114: [clang] A better format for unnecessary packed warning.

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D34114#800253, @rsmith wrote: > Some concrete suggestions throughout the patch, but I think we should take a > step back and reconsider this warning approach: it seems bizarre for us to > warn on any packed struct that happens to contain a

[PATCH] D34114: [clang] A better format for unnecessary packed warning.

2017-07-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 108380. yawanng edited the summary of this revision. yawanng added a comment. Change the condition of this unnecessary packed warning to when the alignment of the class is one byte. Remove all field-level warning. https://reviews.llvm.org/D34114 Files:

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-24 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. Ping https://reviews.llvm.org/D35372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35743: [clang-format] Handle Structured binding declaration in C++17

2017-07-21 Thread Yan Wang via Phabricator via cfe-commits
yawanng created this revision. yawanng added a project: clang-tools-extra. Herald added a subscriber: klimek. Add handling for Structured binding declaration in C++17 in clang-format. For example: auto [x,y] = a; auto &[xr, yr] = a; auto &&[xrr, yrr] = a; https://reviews.llvm.org/D35743

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-20 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 107557. yawanng added a comment. Refactor the check, add a base class for it, which can facilitate all other similar checks. Basically, all checks in the same category will have only one or two lines code by inheriting the base class. If this looks good, I

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-17 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D35372#810525, @alexfh wrote: > In https://reviews.llvm.org/D35372#810457, @alexfh wrote: > > > I have deja vu ;) > > > > Should we make a single check for all CLOEXEC and friends with a single > > configurable list of (function name, flag

[PATCH] D35367: [clang-tidy] Add a close-on-exec check on epoll_create() in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106539. yawanng marked an inline comment as done. Herald added subscribers: xazax.hun, JDevlieghere. https://reviews.llvm.org/D35367 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt

[PATCH] D35365: [clang-tidy] Add a close-on-exec check on epoll_create1() in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106523. yawanng marked 2 inline comments as done. https://reviews.llvm.org/D35365 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecEpollCreate1Check.cpp

[PATCH] D35368: [clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106520. yawanng marked an inline comment as done. Herald added subscribers: xazax.hun, JDevlieghere. https://reviews.llvm.org/D35368 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt

[PATCH] D35370: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106517. yawanng marked an inline comment as done. https://reviews.llvm.org/D35370 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecInotifyInitCheck.cpp

[PATCH] D35372: [clang-tidy] Add a close-on-exec check on memfd_create() in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106515. yawanng marked an inline comment as done. https://reviews.llvm.org/D35372 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecMemfdCreateCheck.cpp

[PATCH] D35362: [clang-tidy] Add close-on-exec checks on several functions in Android module.

2017-07-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng created this revision. yawanng added a project: clang-tools-extra. Herald added subscribers: xazax.hun, JDevlieghere, mgorny. accept() is better to be replaced by accept4() with SOCK_CLOEXEC flag to avoid file descriptor leakage. This is one of a bunch of similar APIs as below and they

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-12 Thread Yan Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307818: [clang-tidy] Add a new Android check "android-cloexec-socket" (authored by yawanng). Changed prior to commit: https://reviews.llvm.org/D34913?vs=106058=106252#toc Repository: rL LLVM

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-12 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D34913#797577, @Eugene.Zelenko wrote: > Please wait for Alexander, Aaron or Haojian approval. Could you please check this CL? Thank you. https://reviews.llvm.org/D34913 ___ cfe-commits mailing

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 106058. yawanng marked 4 inline comments as done. https://reviews.llvm.org/D34913 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp clang-tidy/android/CloexecSocketCheck.cpp

[PATCH] D35194: [clang-tidy] clang-apply-replacements: Don't insert null entry

2017-07-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. LGTM. Please wait for Alexander approval. Comment at: clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:296 + << "' doesn't exist. Ignoring...\n"; +} continue; Maybe add some error message here

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: clang-tidy/utils/ASTUtils.h:27 +/// or | | ... +bool hasFlag(const Expr *Flags, const SourceManager , + const LangOptions , const char *CloseOnExecFlag); alexfh wrote: > `hasFlag` is too generic and may

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-10 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 105878. yawanng marked 5 inline comments as done. https://reviews.llvm.org/D34913 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp clang-tidy/android/CloexecSocketCheck.cpp

[PATCH] D34114: [clang] A better format for unnecessary packed warning.

2017-07-05 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. PING Repository: rL LLVM https://reviews.llvm.org/D34114 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-07-05 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 105293. yawanng marked 8 inline comments as done. https://reviews.llvm.org/D34913 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp clang-tidy/android/CloexecSocketCheck.cpp

[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"

2017-06-30 Thread Yan Wang via Phabricator via cfe-commits
yawanng created this revision. yawanng added a project: clang-tools-extra. Herald added subscribers: xazax.hun, JDevlieghere, mgorny, srhines. socket() is better to include SOCK_CLOEXEC in its type argument to avoid the file descriptor leakage. Repository: rL LLVM

[PATCH] D34633: [clang-tidy] Rename android-file-open-flag and fix a bug

2017-06-29 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 104709. yawanng added a comment. Change the file name in toctree. https://reviews.llvm.org/D34633 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp

[PATCH] D34633: [clang-tidy] Fix a bug in android-file-open-flag

2017-06-29 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 104689. yawanng added a comment. Pull back the previous change. For some reason it's lost. https://reviews.llvm.org/D34633 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp

[PATCH] D34633: [clang-tidy] Fix a bug in android-file-open-flag

2017-06-28 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 104574. yawanng added a comment. Herald added subscribers: mgorny, srhines. rename the check. https://reviews.llvm.org/D34633 Files: clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CloexecOpenCheck.cpp

[PATCH] D34633: [clang-tidy] Fix a bug in android-file-open-flag

2017-06-26 Thread Yan Wang via Phabricator via cfe-commits
yawanng created this revision. yawanng added a project: clang-tools-extra. Herald added subscribers: xazax.hun, JDevlieghere. Handle a case when the function is passed as an argument of a function-like macro. Plus fix a format that was forgotten to commit last time. Repository: rL LLVM

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-19 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 103068. yawanng marked 3 inline comments as done. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D34114: [clang] A better format for unnecessary packed warning.

2017-06-16 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D34114 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-15 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 102690. yawanng added a comment. Format change. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-14 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 102577. yawanng marked 7 inline comments as done. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-14 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: clang-tidy/android/FileOpenFlagCheck.cpp:61 + SourceLocation EndLoc = + Lexer::getLocForEndOfToken(FlagArg->getLocEnd(), 0, SM, getLangOpts()); + hokein wrote: > Instead of using getLangOpts(), you should use

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-13 Thread Yan Wang via Phabricator via cfe-commits
yawanng added inline comments. Comment at: docs/clang-tidy/checks/android-file-open-flag.rst:6 + +A common source of security bugs has been code that opens file without using +the ``O_CLOEXEC`` flag. Without that flag, an opened sensitive file would alexfh

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-09 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 102064. yawanng marked 6 inline comments as done. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D34002: [clang-tidy] When" -fno-exceptions is used", this warning is better to be suppressed.

2017-06-07 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 101834. yawanng marked an inline comment as done. https://reviews.llvm.org/D34002 Files: clang-tidy/misc/NoexceptMoveConstructorCheck.cpp test/clang-tidy/misc-noexcept-move-constructor.cpp Index: test/clang-tidy/misc-noexcept-move-constructor.cpp

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-07 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 101831. yawanng marked an inline comment as done. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-02 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 101279. yawanng added a comment. Format changes. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-06-02 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 101267. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp clang-tidy/android/FileOpenFlagCheck.h

[PATCH] D33304: [clang-tidy][Part1] Add a new module Android and three new checks.

2017-05-31 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 100934. yawanng edited the summary of this revision. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileOpenFlagCheck.cpp

[PATCH] D33304: [clang-tidy] Add a new module Android and three new checks.

2017-05-31 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 100928. yawanng added a comment. Split the commit to three ones that each of them contains one. This is the first part. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp

[PATCH] D33304: [clang-tidy] Add a new module Android and three new checks.

2017-05-31 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D33304#768731, @alexfh wrote: > It's awesome to see another two checks, and it seems to justify adding a > separate module, but I'd prefer the other two checks to be sent for review as > separate patches to make the review easier and faster.

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-30 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 100786. yawanng marked 8 inline comments as done. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CreatUsageCheck.cpp

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-30 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 100782. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/CreatUsageCheck.cpp clang-tidy/android/CreatUsageCheck.h

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-30 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. Hi, I have updated this CL for review. Thank you very much :) https://reviews.llvm.org/D33304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33304: [WIP][clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-30 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 100777. yawanng added a comment. Modify the detection algorithm. Add another two checks and corresponding tests as well as the docs. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp

[PATCH] D33304: [WIP][clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-22 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. I will make some major changes to this CL based on the current suggestions from reviewers and update it for further review later. Thank you for the valuable advice. Repository: rL LLVM https://reviews.llvm.org/D33304

[PATCH] D33304: [WIP][clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-18 Thread Yan Wang via Phabricator via cfe-commits
yawanng added a comment. In https://reviews.llvm.org/D33304#758871, @aaron.ballman wrote: > In https://reviews.llvm.org/D33304#758808, @alexfh wrote: > > > In https://reviews.llvm.org/D33304#758713, @aaron.ballman wrote: > > > > > In https://reviews.llvm.org/D33304#758624, @srhines wrote: > > >

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-18 Thread Yan Wang via Phabricator via cfe-commits
yawanng marked an inline comment as done. yawanng added inline comments. Comment at: clang-tidy/android/FileDescriptorCheck.cpp:76 +int64_t val = aPInt.getSExtValue(); +if((val & O_CLOEXEC) == 0) + return false; srhines wrote: > Using O_CLOEXEC here

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-18 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 99447. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileDescriptorCheck.cpp clang-tidy/android/FileDescriptorCheck.h

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-17 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 99374. yawanng added a comment. Add unit test file. https://reviews.llvm.org/D33304 Files: clang-tidy/CMakeLists.txt clang-tidy/android/AndroidTidyModule.cpp clang-tidy/android/CMakeLists.txt clang-tidy/android/FileDescriptorCheck.cpp

[PATCH] D33304: [clang-tidy] Add a new module Android and a new check for file descriptors.

2017-05-17 Thread Yan Wang via Phabricator via cfe-commits
yawanng created this revision. yawanng added a project: clang-tools-extra. Herald added subscribers: krytarowski, xazax.hun, mgorny, srhines. A common source of security bugs has been code that opens file descriptors without using the O_CLOEXEC flag. (Without that flag, an opened sensitive file

[PATCH] D33103: [clang-tidy] TwineLocalCheck: add param # checking

2017-05-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 98705. yawanng added a comment. Add more tests. https://reviews.llvm.org/D33103 Files: clang-tidy/llvm/TwineLocalCheck.cpp test/clang-tidy/llvm-twine-local.cpp Index: test/clang-tidy/llvm-twine-local.cpp

[PATCH] D33103: [clang-tidy] TwineLocalCheck: add param # checking

2017-05-11 Thread Yan Wang via Phabricator via cfe-commits
yawanng updated this revision to Diff 98684. https://reviews.llvm.org/D33103 Files: clang-tidy/llvm/TwineLocalCheck.cpp test/clang-tidy/llvm-twine-local.cpp Index: test/clang-tidy/llvm-twine-local.cpp === ---