Mercurial > hg > CbC > CbC_llvm
comparison flang/docs/C++style.md @ 223:5f17cb93ff66 llvm-original
LLVM13 (2021/7/18)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:43:00 +0900 |
parents | 79ff65ed7e25 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
222:81f6424ef0e3 | 223:5f17cb93ff66 |
---|---|
113 | 113 |
114 Don't try to make columns of variable names or comments | 114 Don't try to make columns of variable names or comments |
115 align vertically -- they are maintenance problems. | 115 align vertically -- they are maintenance problems. |
116 | 116 |
117 Always wrap the bodies of `if()`, `else`, `while()`, `for()`, `do`, &c. | 117 Always wrap the bodies of `if()`, `else`, `while()`, `for()`, `do`, &c. |
118 with braces, even when the body is a single statement or empty. The | 118 with braces, even when the body is a single statement or empty. Note that this |
119 diverges from the LLVM coding style. In parts of the codebase that make heavy | |
120 use of LLVM or MLIR APIs (e.g. the Lower and Optimizer libraries), use the | |
121 LLVM style instead. The | |
119 opening `{` goes on | 122 opening `{` goes on |
120 the end of the line, not on the next line. Functions also put the opening | 123 the end of the line, not on the next line. Functions also put the opening |
121 `{` after the formal arguments or new-style result type, not on the next | 124 `{` after the formal arguments or new-style result type, not on the next |
122 line. Use `{}` for empty inline constructors and destructors in classes. | 125 line. Use `{}` for empty inline constructors and destructors in classes. |
123 | 126 |