[llvm] [libsycl] Generic code cleanup (PR #224330)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 05:27:38 PDT 2026


================
@@ -95,8 +95,8 @@ template <typename Derived, int Dimensions> class IndexSpaceBase {
 
   friend bool operator==(const IndexSpaceBase<Derived, Dimensions> &lhs,
                          const IndexSpaceBase<Derived, Dimensions> &rhs) {
-    for (int i = 0; i < Dimensions; ++i) {
-      if (lhs.MArray[i] != rhs.MArray[i]) {
+    for (int I = 0; I < Dimensions; ++I) {
+      if (lhs.MArray[I] != rhs.MArray[I]) {
----------------
KseniyaTikhomirova wrote:

I think this case requires braces as stated in https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
```
Use braces in all other cases, including:

Multi-statement bodies

Single-statement bodies with non-hoistable comments

Complex single-statement bodies (e.g., deep nesting, complex nested loops)

Inconsistent bracing within if/else if/else chains (if one block requires braces, all must)

if statements ending with a nested if lacking an else (to prevent “dangling else”)
```

https://github.com/llvm/llvm-project/pull/224330


More information about the llvm-commits mailing list