[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-15 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked an inline comment as done. erichkeane added inline comments. Comment at: llvm/docs/CodingStandards.rst:1600 + // Omit the braces, since the body is simple and clearly associated with the if. + if (isa(D)) +handleFunctionDecl(D); smeenai

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-15 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added inline comments. Comment at: llvm/docs/CodingStandards.rst:1600 + // Omit the braces, since the body is simple and clearly associated with the if. + if (isa(D)) +handleFunctionDecl(D); I'm late to the party here (and I haven't read the

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-11 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc08ea0771682: Add to the Coding Standard our that single-line bodies omit braces (authored by erichkeane). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-04 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast accepted this revision. hubert.reinterpretcast added a comment. This revision is now accepted and ready to land. This LGTM. I believe we have not heard back from @arsenm on the response to some of their comments though. Comment at:

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-04 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 268433. erichkeane marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80947/new/ https://reviews.llvm.org/D80947 Files: llvm/docs/CodingStandards.rst Index: llvm/docs/CodingStandards.rst

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-03 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added inline comments. Comment at: llvm/docs/CodingStandards.rst:1576 + +When writing the body of an `if`, `else`, or loop statement, omit the braces to avoid +unnecessary and otherwise meaningless code. However, braces should be used

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-03 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 268175. erichkeane added a comment. Apply @hubert.reinterpretcast s spelling. I'd also like to re-enforce, the purpose of this patch is simply to write down the rule that we've been enforcing for years, I don't think we should get novel with the

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-03 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 5 inline comments as done. erichkeane added inline comments. Comment at: llvm/docs/CodingStandards.rst:1573 +Don't Use Braces on Simple Single-Statement Bodies of if/else/loop Statements

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-03 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added inline comments. Comment at: llvm/docs/CodingStandards.rst:1573 +Don't Use Braces on Simple Single-Statement Bodies of if/else/loop Statements +^ I would rather just ban

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-02 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added inline comments. Comment at: llvm/docs/CodingStandards.rst:1578 +unnecessary and otherwise meaningless code. Braces should be used however +in cases where it significantly improves readability, such as when the single +statement is accompanied by a

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 6 inline comments as done. erichkeane added inline comments. Comment at: llvm/docs/CodingStandards.rst:1578 +unnecessary and otherwise meaningless code. Braces should be used however +in cases where it significantly improves readability, such as when the single

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 267856. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80947/new/ https://reviews.llvm.org/D80947 Files: llvm/docs/CodingStandards.rst Index: llvm/docs/CodingStandards.rst === ---

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added inline comments. Comment at: llvm/docs/CodingStandards.rst:1582 +clear that it is a single line. Note that comments should only be hoisted for loops and +'if', and not in 'else if' or 'else', where it would be unclear whether the comment +belonged

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 267714. erichkeane added a comment. Attempt improvements based on feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80947/new/ https://reviews.llvm.org/D80947 Files: llvm/docs/CodingStandards.rst Index: llvm/docs/CodingStandards.rst

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 4 inline comments as done. erichkeane added inline comments. Comment at: llvm/docs/CodingStandards.rst:1573 +Don't Use Braces on Simple Single-Statement Bodies of if/else/loop Statements

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Thanks for finally writing this down :) Two minor comments. Comment at: llvm/docs/CodingStandards.rst:1580 +statement is accompanied by a comment that loses its meaning if hoisted above the if +or loop statement, or where the single statement is

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added inline comments. Comment at: llvm/docs/CodingStandards.rst:1580 +statement is accompanied by a comment that loses its meaning if hoisted above the if +or loop statement, or where the single statement is complex enough that it stops being +clear

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Jon Roelofs via Phabricator via cfe-commits
jroelofs accepted this revision. jroelofs added a comment. This revision is now accepted and ready to land. LGTM Comment at: llvm/docs/CodingStandards.rst:1582 +clear that it is a single line. Note that comments should only be hoisted for loops and +'if', and not in 'else if'

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. SGTM Comment at: llvm/docs/CodingStandards.rst:1573 +Don't Use Braces on Simple Single-Statement Bodies of if/else/loop Statements +^ `case` too

[PATCH] D80947: Add to the Coding Standard our that single-line bodies omit braces

2020-06-01 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added reviewers: aaron.ballman, jdoerfert, jroelofs. Herald added a project: LLVM. This is a rule that seems to have been enforced for the better part of the decade, so we should document it for new contributors. Repository: rG LLVM Github Monorepo