Warning: This file is not a C or C++ file. It does not have highlighting.

1//===-- include/flang/Semantics/runtime-type-info.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// BuildRuntimeDerivedTypeTables() translates the scopes of derived types
10// and parameterized derived type instantiations into the type descriptions
11// defined in module/__fortran_type_info.f90, packaging these descriptions
12// as static initializers for compiler-created objects.
13
14#ifndef FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_
15#define FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_
16
17#include "flang/Common/reference.h"
18#include "flang/Semantics/symbol.h"
19#include <map>
20#include <set>
21#include <string>
22#include <vector>
23
24namespace llvm {
25class raw_ostream;
26}
27
28namespace Fortran::semantics {
29
30struct RuntimeDerivedTypeTables {
31 Scope *schemata{nullptr};
32 std::set<std::string> names;
33};
34
35RuntimeDerivedTypeTables BuildRuntimeDerivedTypeTables(SemanticsContext &);
36
37/// Name of the builtin module that defines builtin derived types meant
38/// to describe other derived types at runtime in flang descriptor.
39constexpr char typeInfoBuiltinModule[]{"__fortran_type_info"};
40
41/// Name of the bindings descriptor component in the DerivedType type of the
42/// __Fortran_type_info module
43constexpr char bindingDescCompName[]{"binding"};
44
45/// Name of the __builtin_c_funptr component in the Binding type of the
46/// __Fortran_type_info module
47constexpr char procCompName[]{"proc"};
48
49SymbolVector CollectBindings(const Scope &dtScope);
50
51struct NonTbpDefinedIo {
52 const Symbol *subroutine;
53 common::DefinedIo definedIo;
54 bool isDtvArgPolymorphic;
55};
56
57std::multimap<const Symbol *, NonTbpDefinedIo>
58CollectNonTbpDefinedIoGenericInterfaces(
59 const Scope &, bool useRuntimeTypeInfoEntries);
60
61bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
62 const Scope &, const DerivedTypeSpec *);
63bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
64 const Scope &, const DeclTypeSpec *);
65bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
66 const Scope &, const Symbol *);
67
68} // namespace Fortran::semantics
69#endif // FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_
70

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of flang/include/flang/Semantics/runtime-type-info.h