From 13f88a1400e2f3a219b69d2cf4cc2c256c4d895a Mon Sep 17 00:00:00 2001 From: peter klausler Date: Wed, 16 May 2018 13:50:04 -0700 Subject: [PATCH] [flang] more thinking about requirements for defined assignment &c. Original-commit: flang-compiler/f18@20fb1a40452dc21bafe601247375165525539f3e Reviewed-on: https://github.com/flang-compiler/f18/pull/92 Tree-same-pre-rewrite: false --- flang/runtime/descriptor.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flang/runtime/descriptor.h b/flang/runtime/descriptor.h index bcbc80e..35811d3 100644 --- a/flang/runtime/descriptor.h +++ b/flang/runtime/descriptor.h @@ -161,6 +161,7 @@ public: } std::size_t SizeInBytes() const; + // TODO: initialization? assignment? finalization? private: // These values must coexist with the ISO_Fortran_binding.h definitions @@ -240,8 +241,7 @@ private: }; struct ExecutableCode { - void (*host)(Descriptor *); - void (*device)(Descriptor *); + std::intptr_t host, device; }; struct TypeBoundProcedure { @@ -261,7 +261,6 @@ struct ProcedurePointer { // Extended derived types have the EXTENDS flag set and place their base // component first in the component descriptions, which is significant for // the execution of FINAL subroutines. -// TODO: Link to defined assignment subroutines and their characteristics. class DerivedType { public: const char *name() const { return name_; } @@ -278,9 +277,10 @@ public: const ExecutableCode &typeBoundProcedure(int n) const { return typeBoundProcedure_[n]; } - const ExecutableCode &finalSubroutine() const { return finalSubroutine_; } bool IsSameType(const DerivedType &); + void CallFinalSubroutine(const Descriptor &); + void AssignScalar(const Descriptor &to, const Descriptor &from); private: enum Flag { EXTENDS = 1, SEQUENCE = 2, BIND = 4, ANY_PRIVATE = 8 }; @@ -298,6 +298,7 @@ private: const ExecutableCode *typeBoundProcedure_; // array of overridable TBP bindings ExecutableCode finalSubroutine_; // resolved at compilation, can be null + ExecutableCode assignment_; // resolved at compilation, must not be null }; // The storage for this object follows the last used dim[] entry in a -- 2.7.4