diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2022-06-24 02:26:07 +0200 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2022-06-24 02:40:25 +0200 |
commit | 37b881aa0bca09b7cc80575cc4b97453aa724186 (patch) | |
tree | f4ca8c1c32e07849209830ce70e8605bb29f8b05 /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 8b987ca5e37ee670dface295bd147b8d6d312084 (diff) | |
download | llvm-37b881aa0bca09b7cc80575cc4b97453aa724186.zip llvm-37b881aa0bca09b7cc80575cc4b97453aa724186.tar.gz llvm-37b881aa0bca09b7cc80575cc4b97453aa724186.tar.bz2 |
clang: Tweak behaviour of warn_empty_while_body and warn_empty_if_body
Use the if/while statement right paren location instead of the end of the
condition expression to determine if the semicolon is on its own line, for the
purpose of not warning about code like this:
while (foo())
;
Using the condition location meant that we would also not report a warning on
code like this:
while (MACRO(a,
b));
body();
The right paren loc wasn't stored in the AST or passed into Sema::ActOnIfStmt
when this logic was first written.
Reviewed By: rnk, gribozavr2
Differential Revision: https://reviews.llvm.org/D128406
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
0 files changed, 0 insertions, 0 deletions