Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Implement derived type description table encoding
Define Fortran derived types that describe the characteristics of derived types, and instantiations of parameterized derived types, that are of relevance to the runtime language support library. Define a suite of corresponding C++ structure types for the runtime library to use to interpret instances of the descriptions. Create instances of these description types in Semantics as static initializers for compiler-created objects in the scopes that define or instantiate user derived types. Delete obsolete code from earlier attempts to package runtime type information. Differential Revision: https://reviews.llvm.org/D92802
- Loading branch information
Showing
25 changed files
with
1,775 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//===-- include/flang/Semantics/runtime-type-info.h -------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// BuildRuntimeDerivedTypeTables() translates the scopes of derived types | ||
// and parameterized derived type instantiations into the type descriptions | ||
// defined in module/__fortran_type_info.f90, packaging these descriptions | ||
// as static initializers for compiler-created objects. | ||
|
||
#ifndef FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_ | ||
#define FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_ | ||
|
||
#include <set> | ||
#include <string> | ||
|
||
namespace llvm { | ||
class raw_ostream; | ||
} | ||
|
||
namespace Fortran::semantics { | ||
class Scope; | ||
class SemanticsContext; | ||
class Symbol; | ||
|
||
struct RuntimeDerivedTypeTables { | ||
Scope *schemata{nullptr}; | ||
std::set<std::string> names; | ||
}; | ||
|
||
RuntimeDerivedTypeTables BuildRuntimeDerivedTypeTables(SemanticsContext &); | ||
|
||
void Dump(llvm::raw_ostream &, const RuntimeDerivedTypeTables &); | ||
} // namespace Fortran::semantics | ||
#endif // FORTRAN_SEMANTICS_RUNTIME_TYPE_INFO_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.