This is an archive of the discontinued LLVM Phabricator instance.

[flang] Finish substring lowering
ClosedPublic

Authored by jeanPerier on Dec 19 2022, 9:03 AM.

Details

Summary

Hlfir.designate was made to support substrings but so far substrings
were not yet lowered to it. Implement support for them.

Diff Detail

Event Timeline

jeanPerier created this revision.Dec 19 2022, 9:03 AM
Herald added a project: Restricted Project. · View Herald Transcript
jeanPerier requested review of this revision.Dec 19 2022, 9:03 AM
PeteSteinfeld accepted this revision.Dec 19 2022, 10:55 AM

Other than the one nit, all builds and tests correctly and looks good.

flang/lib/Lower/ConvertExprToHLFIR.cpp
178–181

Braces aren't needed for the "then" part of this "if".

This revision is now accepted and ready to land.Dec 19 2022, 10:55 AM
vzakhari added inline comments.
flang/lib/Lower/ConvertExprToHLFIR.cpp
178–181

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);
}
PeteSteinfeld added inline comments.Dec 19 2022, 1:00 PM
flang/lib/Lower/ConvertExprToHLFIR.cpp
178–181

Thanks for letting me know!

This revision was automatically updated to reflect the committed changes.