[flang-commits] [PATCH] D151106: [flang][NFC] Move Array constructor inlined temp management into a utility

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon May 22 07:49:36 PDT 2023


jeanPerier created this revision.
jeanPerier added reviewers: vzakhari, tblah, clementval.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, mehdi_amini, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
jeanPerier requested review of this revision.

This patch moves the counter and storage management part of the array
constructor inlined temporary strategy into its own utility so that it
can be reused for the simple cases of temporary creations inside WHERE
and FORALL.

It actually fixes a bug where the counter first value  used for addressing
was "2" leading to read/write after the allocated storage... It seems
I ran the tests end-to-end without the HLFIR flag when previously testing
this. So this may clear some segfaults.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151106

Files:
  flang/include/flang/Optimizer/Builder/HLFIRTools.h
  flang/include/flang/Optimizer/Builder/TemporaryStorage.h
  flang/lib/Lower/ConvertArrayConstructor.cpp
  flang/lib/Optimizer/Builder/CMakeLists.txt
  flang/lib/Optimizer/Builder/TemporaryStorage.cpp
  flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90
  flang/test/Lower/HLFIR/array-ctor-character.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151106.524311.patch
Type: text/x-patch
Size: 33040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230522/2640b332/attachment-0001.bin>


More information about the flang-commits mailing list