[flang-commits] [PATCH] D140310: [flang] Finish substring lowering
Pete Steinfeld via Phabricator via flang-commits
flang-commits at lists.llvm.org
Mon Dec 19 13:00:42 PST 2022
PeteSteinfeld added inline comments.
================
Comment at: flang/lib/Lower/ConvertExprToHLFIR.cpp:178-181
+ if (cstLen) {
+ partInfo.typeParams[0] =
+ builder.createIntegerConstant(loc, idxTy, *cstLen);
+ } else {
----------------
vzakhari wrote:
> PeteSteinfeld wrote:
> > Braces aren't needed for the "then" part of this "if".
> Pete, it is actually required by LLVM coding style (https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements):
> ```
> // 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);
> }
> ```
Thanks for letting me know!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140310/new/
https://reviews.llvm.org/D140310
More information about the flang-commits
mailing list