Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit code for LLVM style: single-line if statements with braces #1015

Open
RichBarton-Arm opened this issue Feb 24, 2020 · 1 comment
Open

Comments

@RichBarton-Arm
Copy link
Contributor

LLVM projects have a de-facto coding style guideline that single line if statements not have braces. F18 does not currently follow this de-facto style.
For example, in include/flang/common/format.h:
if (suppressMessageCascade_) { return; }
This style is not officially part of the LLVM style guide and we suspect that there is a reasonable groundswell of opinion in the LLVM community that it is a bad style point and ought not to be the de-facto standard. We could open this debate on the llvm-dev list and ask the community to reconsider.

Outcomes:

  1. We start an RFC on llvm-dev to have the style guide clarified in this regard.
  2. The LLVM coding standard is updated with a final decision on this
  3. IF the final decision is to make the no braces on single-line if statements style official, change F18 codebase to match.
@sscalpone
Copy link
Member

Are we agreed that a single statement if that is not on a single line must use braces?

https://medium.com/@jonathanabrams/single-line-if-statements-2565c62ff492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants