diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /flang/lib/Lower/ConvertVariable.cpp | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'flang/lib/Lower/ConvertVariable.cpp')
| -rw-r--r-- | flang/lib/Lower/ConvertVariable.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/flang/lib/Lower/ConvertVariable.cpp b/flang/lib/Lower/ConvertVariable.cpp index 197e526973b4..9ee42d5cd880 100644 --- a/flang/lib/Lower/ConvertVariable.cpp +++ b/flang/lib/Lower/ConvertVariable.cpp @@ -39,7 +39,7 @@ #include "flang/Optimizer/Support/FatalError.h" #include "flang/Optimizer/Support/InternalNames.h" #include "flang/Optimizer/Support/Utils.h" -#include "flang/Runtime/allocator-registry.h" +#include "flang/Runtime/allocator-registry-consts.h" #include "flang/Semantics/runtime-type-info.h" #include "flang/Semantics/tools.h" #include "llvm/Support/CommandLine.h" @@ -798,6 +798,20 @@ void Fortran::lower::defaultInitializeAtRuntime( } } +/// Call clone initialization runtime routine to initialize \p sym's value. +void Fortran::lower::initializeCloneAtRuntime( + Fortran::lower::AbstractConverter &converter, + const Fortran::semantics::Symbol &sym, Fortran::lower::SymMap &symMap) { + fir::FirOpBuilder &builder = converter.getFirOpBuilder(); + mlir::Location loc = converter.getCurrentLocation(); + fir::ExtendedValue exv = converter.getSymbolExtendedValue(sym, &symMap); + mlir::Value newBox = builder.createBox(loc, exv); + lower::SymbolBox hsb = converter.lookupOneLevelUpSymbol(sym); + fir::ExtendedValue hexv = converter.symBoxToExtendedValue(hsb); + mlir::Value box = builder.createBox(loc, hexv); + fir::runtime::genDerivedTypeInitializeClone(builder, loc, newBox, box); +} + enum class VariableCleanUp { Finalize, Deallocate }; /// Check whether a local variable needs to be finalized according to clause /// 7.5.6.3 point 3 or if it is an allocatable that must be deallocated. Note |
