[PATCH] D119555: [flang] Fail at link time if derived type descriptors were not generated

Jean Perier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 02:11:36 PST 2022


jeanPerier marked 2 inline comments as done.
jeanPerier added inline comments.


================
Comment at: flang/include/flang/Common/builtin-modules.h:1
+//===-- include/flang/Common/builtin-modules.h ------------------*- C++ -*-===//
+//
----------------
klausler wrote:
> I'm not sure that /Common is the right place for this -- the name could be defined in semantics and referenced from lowering via the SemanticsContext.
OK, a new header is actually not that useful, I moved this definition directly in `Semantics/runtime-type-info.h`. However, it is not possible to use the SemanticsContext in the part where I need to know if a types comes from the type info module.

The current mapping between derived types and their type descriptors happens late: In the pass from MLIR to LLVM IR. At that stage, we have a FIR operation `fir.embox ... : fir.box<fir.type<a_derived_type>>` that means create a descriptor for an object of type `a_derived_type` and the translation pass to LLVM IR will find the type descriptor global object from the type name (plus some scope information mangled in the type name). The semantic context is not available anymore at that stage (at the MLIR level, the compilation could stop and dump the IR, and the LLVM translation pass can start back from that).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119555/new/

https://reviews.llvm.org/D119555



More information about the llvm-commits mailing list