In article ,
Aaron Ballman writes:
> On Wed, Feb 3, 2016 at 3:57 PM, Kim Gräsman wrote:
> > On Mon, Feb 1, 2016 at 4:32 PM, Aaron Ballman
> wrote:
> >>
> >>
> >> Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:60
> >> @@ +59,3 @@
> >> + if (const auto *R
On Wed, Feb 3, 2016 at 3:57 PM, Kim Gräsman wrote:
> On Mon, Feb 1, 2016 at 4:32 PM, Aaron Ballman wrote:
>>
>>
>> Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:60
>> @@ +59,3 @@
>> + if (const auto *Return = dyn_cast(*last))
>> +issueDiagnostic(Result, Bl
On Mon, Feb 1, 2016 at 4:32 PM, Aaron Ballman wrote:
>
>
> Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:60
> @@ +59,3 @@
> + if (const auto *Return = dyn_cast(*last))
> +issueDiagnostic(Result, Block, Return->getSourceRange(),
> +Redund
alexfh added a comment.
Thank you for adding more test cases! Could you address one more comment in a
follow-up, please?
Comment at: test/clang-tidy/readability-redundant-control-flow.cpp:193
@@ +192,3 @@
+// CHECK-FIXES-NEXT: {{^return;$}}
+// CHECK-FIXES-NEXT: {{^ *}$}}
+
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
With one small nit to the diagnostic wording for consistency, LGTM! I will go
ahead and make that change, then commit on your behalf. You may want to talk to
Chris Lattner about
aaron.ballman closed this revision.
aaron.ballman added a comment.
I have commit in r259362. Thank you!
http://reviews.llvm.org/D16259
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
LegalizeAdulthood marked 4 inline comments as done.
Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:59
@@ +58,3 @@
+ CompoundStmt::const_reverse_body_iterator last = Block->body_rbegin();
+ if (const auto *Return = dyn_cast(*last)) {
+issueDiagnostic(Result,
LegalizeAdulthood updated this revision to Diff 46334.
LegalizeAdulthood marked an inline comment as done.
LegalizeAdulthood added a comment.
Update from review comments
http://reviews.llvm.org/D16259
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.
Eugene.Zelenko added a comment.
Just encountered next situation in my work code base:
void Function() {
...
if (Condition) {
}
else
return;
}
http://reviews.llvm.org/D16259
___
cfe-commits mailing list
cfe-commits@lists.l
aaron.ballman added inline comments.
Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:24
@@ +23,3 @@
+const char *const RedundantReturnDiag =
+"redundant return statement at the end of void function";
+const char *const RedundantContinueDiag =
LegalizeAdulthood updated this revision to Diff 45842.
LegalizeAdulthood added a comment.
Improve matcher to simplify callback
http://reviews.llvm.org/D16259
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/readability/RedundantContr
LegalizeAdulthood retitled this revision from "Add clang-tidy
readability-redundant-return check" to "Add clang-tidy
readability-redundant-control-flow check".
LegalizeAdulthood updated this revision to Diff 45814.
LegalizeAdulthood marked an inline comment as done.
LegalizeAdulthood added a comm
12 matches
Mail list logo