Skip to content

Commit

Permalink
[flang] Lower allocate and deallocate statements
Browse files Browse the repository at this point in the history
This patch add the lowering for the allocate
and the deallocate statements.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121146

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
  • Loading branch information
4 people committed Mar 7, 2022
1 parent 844a9c0 commit c5cf1b9
Show file tree
Hide file tree
Showing 4 changed files with 724 additions and 2 deletions.
13 changes: 13 additions & 0 deletions flang/include/flang/Lower/Allocatable.h
Expand Up @@ -26,13 +26,26 @@ namespace fir {
class MutableBoxValue;
} // namespace fir

namespace Fortran::parser {
struct AllocateStmt;
struct DeallocateStmt;
} // namespace Fortran::parser

namespace Fortran::lower {
class AbstractConverter;

namespace pft {
struct Variable;
}

/// Lower an allocate statement to fir.
void genAllocateStmt(Fortran::lower::AbstractConverter &,
const Fortran::parser::AllocateStmt &, mlir::Location);

/// Lower a deallocate statement to fir.
void genDeallocateStmt(Fortran::lower::AbstractConverter &,
const Fortran::parser::DeallocateStmt &, mlir::Location);

/// Create a MutableBoxValue for an allocatable or pointer entity.
/// If the variables is a local variable that is not a dummy, it will be
/// initialized to unallocated/disassociated status.
Expand Down

0 comments on commit c5cf1b9

Please sign in to comment.