Warning: This file is not a C or C++ file. It does not have highlighting.
1 | //===-- include/flang/Runtime/assign.h --------------------------*- C++ -*-===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // External APIs for data assignment (both intrinsic assignment and TBP defined |
10 | // generic ASSIGNMENT(=)). Should be called by lowering for any assignments |
11 | // possibly needing special handling. Intrinsic assignment to non-allocatable |
12 | // variables whose types are intrinsic need not come through here (though they |
13 | // may do so). Assignments to allocatables, and assignments whose types may be |
14 | // polymorphic or are monomorphic and of derived types with finalization, |
15 | // allocatable components, or components with type-bound defined assignments, in |
16 | // the original type or the types of its non-pointer components (recursively) |
17 | // must arrive here. |
18 | // |
19 | // Non-type-bound generic INTERFACE ASSIGNMENT(=) is resolved in semantics and |
20 | // need not be handled here in the runtime apart from derived type components; |
21 | // ditto for type conversions on intrinsic assignments. |
22 | |
23 | #ifndef FORTRAN_RUNTIME_ASSIGN_H_ |
24 | #define FORTRAN_RUNTIME_ASSIGN_H_ |
25 | |
26 | #include "flang/Runtime/entry-names.h" |
27 | |
28 | namespace Fortran::runtime { |
29 | class Descriptor; |
30 | |
31 | extern "C" { |
32 | // API for lowering assignment |
33 | void RTDECL(Assign)(Descriptor &to, const Descriptor &from, |
34 | const char *sourceFile = nullptr, int sourceLine = 0); |
35 | // This variant has no finalization, defined assignment, or allocatable |
36 | // reallocation. |
37 | void RTDECL(AssignTemporary)(Descriptor &to, const Descriptor &from, |
38 | const char *sourceFile = nullptr, int sourceLine = 0); |
39 | void RTDECL(CopyOutAssign)(Descriptor &to, const Descriptor &from, |
40 | bool skipToInit, const char *sourceFile = nullptr, int sourceLine = 0); |
41 | // This variant is for assignments to explicit-length CHARACTER left-hand |
42 | // sides that might need to handle truncation or blank-fill, and |
43 | // must maintain the character length even if an allocatable array |
44 | // is reallocated. |
45 | void RTDECL(AssignExplicitLengthCharacter)(Descriptor &to, |
46 | const Descriptor &from, const char *sourceFile = nullptr, |
47 | int sourceLine = 0); |
48 | // This variant is assignments to whole polymorphic allocatables. |
49 | void RTDECL(AssignPolymorphic)(Descriptor &to, const Descriptor &from, |
50 | const char *sourceFile = nullptr, int sourceLine = 0); |
51 | } // extern "C" |
52 | } // namespace Fortran::runtime |
53 | #endif // FORTRAN_RUNTIME_ASSIGN_H_ |
54 |
Warning: This file is not a C or C++ file. It does not have highlighting.