diff options
Diffstat (limited to 'flang-rt/lib/runtime/pointer.cpp')
-rw-r--r-- | flang-rt/lib/runtime/pointer.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/flang-rt/lib/runtime/pointer.cpp b/flang-rt/lib/runtime/pointer.cpp index 04487ab..68db259 100644 --- a/flang-rt/lib/runtime/pointer.cpp +++ b/flang-rt/lib/runtime/pointer.cpp @@ -87,9 +87,9 @@ void RTDEF(PointerAssociateLowerBounds)(Descriptor &pointer, } } -void RTDEF(PointerAssociateRemapping)(Descriptor &pointer, +static void RT_API_ATTRS PointerRemapping(Descriptor &pointer, const Descriptor &target, const Descriptor &bounds, const char *sourceFile, - int sourceLine) { + int sourceLine, bool isMonomorphic) { Terminator terminator{sourceFile, sourceLine}; SubscriptValue byteStride{/*captured from first dimension*/}; std::size_t boundElementBytes{bounds.ElementBytes()}; @@ -99,7 +99,7 @@ void RTDEF(PointerAssociateRemapping)(Descriptor &pointer, // the ranks may mismatch. Use target as a mold for initializing // the pointer descriptor. INTERNAL_CHECK(static_cast<std::size_t>(pointer.rank()) == boundsRank); - pointer.ApplyMold(target, boundsRank); + pointer.ApplyMold(target, boundsRank, isMonomorphic); pointer.set_base_addr(target.raw().base_addr); pointer.raw().attribute = CFI_attribute_pointer; for (unsigned j{0}; j < boundsRank; ++j) { @@ -124,6 +124,19 @@ void RTDEF(PointerAssociateRemapping)(Descriptor &pointer, } } +void RTDEF(PointerAssociateRemapping)(Descriptor &pointer, + const Descriptor &target, const Descriptor &bounds, const char *sourceFile, + int sourceLine) { + PointerRemapping( + pointer, target, bounds, sourceFile, sourceLine, /*isMonomorphic=*/false); +} +void RTDEF(PointerAssociateRemappingMonomorphic)(Descriptor &pointer, + const Descriptor &target, const Descriptor &bounds, const char *sourceFile, + int sourceLine) { + PointerRemapping( + pointer, target, bounds, sourceFile, sourceLine, /*isMonomorphic=*/true); +} + RT_API_ATTRS void *AllocateValidatedPointerPayload( std::size_t byteSize, int allocatorIdx) { // Add space for a footer to validate during deallocation. |