[PATCH] D121921: [BOLT] Avoid pointless loop rotation

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 08:00:13 PDT 2022


yota9 added a comment.

@spupyrev I don't see strict rules about the else/eslse if statement indeed. This is clearly personal preference, I hust don't like the idea of extra nesting where you can go without it. As for my personal experience LLVM tries to eliminate extra nesting where it is possible. But speaking of the new variant - I think you need to add braces for "else if "  statement, since in coding style https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements there are some words about the if/else statement to be uniform e.g.

  // Use braces for the `if` block to keep it uniform with the else block.
  if (isa<FunctionDecl>(D)) {
    handleFunctionDecl(D);
  } else {
    // In this else case, it is necessary that we explain the situation with this
    // surprisingly long comment, so it would be unclear without the braces whether
    // the following statement is in the scope of the `if`.
    handleOtherDecl(D);
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121921/new/

https://reviews.llvm.org/D121921



More information about the llvm-commits mailing list