13#ifndef FORTRAN_OPTIMIZER_BUILDER_MUTABLEBOX_H
14#define FORTRAN_OPTIMIZER_BUILDER_MUTABLEBOX_H
16#include "flang/Optimizer/Builder/BoxValue.h"
17#include "flang/Runtime/allocator-registry-consts.h"
18#include "llvm/ADT/StringRef.h"
46 mlir::ValueRange nonDeferredParams,
47 mlir::Value typeSourceBox = {},
48 unsigned allocator = kDefaultAllocator);
55 mlir::Location loc, mlir::Type type,
56 llvm::StringRef name = {},
57 mlir::Value sourceBox = {},
58 bool isPolymorphic =
false);
66 mlir::ValueRange lbounds);
76 mlir::ValueRange lbounds,
77 mlir::ValueRange ubounds);
85 bool polymorphicSetType =
true,
86 unsigned allocator = kDefaultAllocator);
101 mlir::Value oldAddress;
102 mlir::Value wasReallocated;
103 mlir::Value oldAddressWasAllocated;
118 mlir::ValueRange lenParams,
123 bool takeLboundsIfRealloc,
124 const MutableBoxReallocation &realloc);
134 mlir::ValueRange lbounds, mlir::ValueRange extents,
135 mlir::ValueRange lenParams, llvm::StringRef allocName,
136 bool mustBeHeap =
false);
156 bool mayBePolymorphic =
true,
157 bool preserveLowerBounds =
true);
Definition: BoxValue.h:478
Definition: FIRBuilder.h:55
Definition: BoxValue.h:360
Definition: BoxValue.h:445
mlir::Value genIsNotAllocatedOrAssociatedTest(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:475
mlir::Value genIsAllocatedOrAssociatedTest(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:468
void associateMutableBox(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box, const fir::ExtendedValue &source, mlir::ValueRange lbounds)
Definition: MutableBox.cpp:510
mlir::Value genFreemem(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:788
fir::ExtendedValue genMutableBoxRead(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box, bool mayBePolymorphic=true, bool preserveLowerBounds=true)
Definition: MutableBox.cpp:430
void genFreememIfAllocated(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:493
fir::MutableBoxValue createTempMutableBox(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type type, llvm::StringRef name={}, mlir::Value sourceBox={}, bool isPolymorphic=false)
Definition: MutableBox.cpp:388
void disassociateMutableBox(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box, bool polymorphicSetType=true, unsigned allocator=kDefaultAllocator)
Definition: MutableBox.cpp:697
mlir::Value genNullBoxStorage(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type boxTy)
Definition: MutableBox.cpp:970
std::function< void(fir::ExtendedValue)> ReallocStorageHandlerFunc
Definition: MutableBox.h:113
mlir::Value createUnallocatedBox(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type boxType, mlir::ValueRange nonDeferredParams, mlir::Value typeSourceBox={}, unsigned allocator=kDefaultAllocator)
Definition: MutableBox.cpp:332
void associateMutableBoxWithRemap(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box, const fir::ExtendedValue &source, mlir::ValueRange lbounds, mlir::ValueRange ubounds)
Definition: MutableBox.cpp:596
void syncMutableBoxFromIRBox(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:964
mlir::Value getMutableIRBox(fir::FirOpBuilder &builder, mlir::Location loc, const fir::MutableBoxValue &box)
Definition: MutableBox.cpp:958
Definition: AbstractConverter.h:31
@ Value
Lower argument to a value. Mainly intended for scalar arguments.
Definition: AbstractConverter.h:27
Definition: MutableBox.h:99