FLANG
runtime-type-info.h
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/Semantics/symbol.h"
18#include <map>
19#include <set>
20#include <string>
21
22namespace llvm {
23class raw_ostream;
24}
25
26namespace Fortran::semantics {
27
29 Scope *schemata{nullptr};
30 std::set<std::string> names;
31};
32
33RuntimeDerivedTypeTables BuildRuntimeDerivedTypeTables(SemanticsContext &);
34
37constexpr char typeInfoBuiltinModule[]{"__fortran_type_info"};
38
41constexpr char typeDescriptorTypeName[]{"derivedtype"};
42
45constexpr char bindingDescCompName[]{"binding"};
46
49constexpr char procCompName[]{"proc"};
50
51SymbolVector CollectBindings(const Scope &dtScope);
52
53enum NonTbpDefinedIoFlags {
54 IsDtvArgPolymorphic = 1 << 0,
55 DefinedIoInteger8 = 1 << 1,
56};
57
59 const Symbol *subroutine;
60 common::DefinedIo definedIo;
61 std::uint8_t flags;
62};
63
64std::multimap<const Symbol *, NonTbpDefinedIo>
65CollectNonTbpDefinedIoGenericInterfaces(
66 const Scope &, bool useRuntimeTypeInfoEntries);
67
68bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
69 const Scope &, const DerivedTypeSpec *);
70bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
71 const Scope &, const DeclTypeSpec *);
72bool ShouldIgnoreRuntimeTypeInfoNonTbpGenericInterfaces(
73 const Scope &, const Symbol *);
74
75} // namespace Fortran::semantics
76#endif // FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_
Definition scope.h:68
Definition semantics.h:67
Definition symbol.h:893
Definition runtime-type-info.h:58
Definition runtime-type-info.h:28