[compiler-rt] [scudo] Support no-preserve-all-regions mode (PR #85149)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 14:43:25 PDT 2024


================
@@ -251,9 +238,10 @@ template <typename Config> class SizeClassAllocator64 {
         }
 
         const bool RegionIsExhausted = Region->Exhausted;
-        if (!RegionIsExhausted)
+        if (!RegionIsExhausted) {
----------------
ChiaHungDuan wrote:

It's single statement but in multiple lines (because of the format). I know there's no explicit rule for this but I prefer to still have braces to make it less ambiguity. Which is similar to single-statement but with comment on that statement, the coding style suggests using braces

```
// Use braces for the outer `if` since the nested `for` is braced.
if (isa<FunctionDecl>(D)) {
  for (auto *A : D.attrs()) {
    // In this `for` loop body, it is necessary that we explain the situation
    // with this surprisingly long comment, forcing braces on the `for` block.
    handleAttr(A);
  }
}
```

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


More information about the llvm-commits mailing list