[PATCH] D89918: Fix issue: clang-format result is not consistent if "// clang-format off" is followed by macro definition.

2020-10-21 Thread Yubo Xie via Phabricator via cfe-commits
xyb created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. xyb requested review of this revision. For example, the above code: void main() { // clang-format off #define Sum(x, y) ((x) + (y)) Sum(1, 2); #undef Sum // clang-fo

[PATCH] D67501: [clang-tidy] Fix relative path in header-filter.

2019-09-23 Thread Yubo Xie via Phabricator via cfe-commits
xyb added a comment. > The only workable suggestion that we could come up with was adding a separate > command-line option, `-normalized-header-filter`, that would normalize paths > before matching the regex. It can be used by people whose project layout does > not have complex symlink mazes.

[PATCH] D67501: [clang-tidy] Fix relative path in header-filter.

2019-09-20 Thread Yubo Xie via Phabricator via cfe-commits
xyb added a comment. Yes, I need your help to submit the patch. I don't have the permission. Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67501/new/ https://reviews.llvm.org/D67501 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D67501: [clang-tidy] Fix relative path in header-filter.

2019-09-20 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 220997. xyb marked 2 inline comments as done. xyb added a comment. Updated CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67501/new/ https://reviews.llvm.org/D67501 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tools-extr

[PATCH] D67501: [clang-tidy] Fix relative path in header-filter.

2019-09-12 Thread Yubo Xie via Phabricator via cfe-commits
xyb created this revision. xyb added a reviewer: alexfh. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. Clang-tidy supports output diagnostics from header files if user specifies --header-filter. But it can't handle relative path well. For example, the folder stru

[PATCH] D67084: [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-05 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 218893. xyb added a comment. Rebase patch with current HEAD. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67084/new/ https://reviews.llvm.org/D67084 Files: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/test/clang

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-05 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 218892. xyb added a comment. Update patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67056/new/ https://reviews.llvm.org/D67056 Files: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/clang-tidy/bugprone/Argument

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb marked 2 inline comments as done. xyb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp:28 + IgnoreSingleArgument( + Options.getLocalOrGlobal("IgnoreSingleArgument", 0) != 0), CommentBoolLiterals(Options.get

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 218741. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67056/new/ https://reviews.llvm.org/D67056 Files: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.h clang-tools-extra/do

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp:28 + IgnoreSingleArgument( + Options.getLocalOrGlobal("IgnoreSingleArgument", 0) != 0), CommentBoolLiterals(Options.getLocalOrGlobal("CommentBoolLiterals", 0

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb added a comment. Thanks. BTW, I can't commit the patch by myself. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67056/new/ https://reviews.llvm.org/D67056 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D67080: [clang-tidy] Fix bugprone-argument-comment bug if there are marcos.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb added a comment. Thanks. BTW, I can't commit the patch by myself. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67080/new/ https://reviews.llvm.org/D67080 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D67084: [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb added a comment. Thanks. BTW, I can't commit the patch by myself. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67084/new/ https://reviews.llvm.org/D67084 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D67084: [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 218683. xyb added a comment. Update with full diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67084/new/ https://reviews.llvm.org/D67084 Files: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/test/clang-tidy/bug

[PATCH] D67084: [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-04 Thread Yubo Xie via Phabricator via cfe-commits
xyb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp:240 + Arg = Arg->IgnoreImpCasts(); + if (isa(Arg)) + Arg = cast(Arg)->getSubExpr(); aaron.ballman wrote: > The bug claims that this is only for handling n

[PATCH] D67084: Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-02 Thread Yubo Xie via Phabricator via cfe-commits
xyb created this revision. xyb added a reviewer: alexfh. Herald added a project: clang. Herald added a subscriber: cfe-commits. For example: void foo(int a); foo(-2); should be fixed as: foo(/*a=*/-2); This change tries to fix this issue. Repository: rCTE Clang Tools Extra https://r

[PATCH] D67080: Fix bugprone-argument-comment bug if there are marcos.

2019-09-02 Thread Yubo Xie via Phabricator via cfe-commits
xyb updated this revision to Diff 218372. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67080/new/ https://reviews.llvm.org/D67080 Files: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tools-extra/test/clang-tidy/bugprone-argument-comment-literals.cpp Index: c

[PATCH] D67080: Fix bugprone-argument-comment bug if there are marcos.

2019-09-02 Thread Yubo Xie via Phabricator via cfe-commits
xyb created this revision. xyb added a reviewer: alexfh. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix bugprone-argument-comment bug if there are marcos. For example: #define X(x) (x) void j(int a, int b, int c); j(X(1), /*b=*/1, X(1)); clang-tidy can't recogn

[PATCH] D67056: Add a bugprone-argument-comment option: IgnoreSingleArgument.

2019-09-01 Thread Yubo Xie via Phabricator via cfe-commits
xyb created this revision. xyb added a reviewer: alexfh. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add bugprone-argument-comment option: IgnoreSingleArgument. When true, the check will ignore the single argument. Sometimes, it's not necessary to add comment to single