[PATCH] D113769: [fir] !fir.tdesc type conversion

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 11:28:26 PST 2021


schweitz added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/TypeConverter.h:282-283
+  // fir.tdesc<any>  -->  llvm<"i8*">
+  // TODO: For now use a void*, however pointer identity is not sufficient for
+  // the f18 object v. class distinction (F2003).
+  mlir::Type convertTypeDescType(mlir::MLIRContext *ctx) {
----------------
clementval wrote:
> awarzynski wrote:
> > What's the f18 object?
> Not the original author of this comment but I guess it refers to type vs. class. 
Correct.

An entity of derived type (an object), can need both an "is_a" test (is this object exactly class B) and a subclassing test (is this object of some class D which is or is derived from B).

Clearly a trivial pointer comparison of the type descriptor of the entity/object is insufficient to implement both of these tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113769



More information about the llvm-commits mailing list