From ccec5dde81b2dc4d9e598a0fe467808b158514ad Mon Sep 17 00:00:00 2001 From: Stephane Chauveau Date: Thu, 12 Apr 2018 17:27:55 +0200 Subject: [PATCH] [flang] add accessor to derived type definition Original-commit: flang-compiler/f18@d971f4f1acd9e1e2cfb76c390a671238f39e6951 Reviewed-on: https://github.com/flang-compiler/f18/pull/51 Tree-same-pre-rewrite: false --- flang/lib/semantics/type.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flang/lib/semantics/type.h b/flang/lib/semantics/type.h index 9d2d19d2..df9c7ce 100644 --- a/flang/lib/semantics/type.h +++ b/flang/lib/semantics/type.h @@ -463,7 +463,7 @@ using ParamValue = LenParamValue; class DerivedTypeSpec : public TypeSpec { public: std::ostream &Output(std::ostream &o) const override { return o << *this; } - DerivedTypeSpec(const Name &name) : name_{name} {} + DerivedTypeSpec(const Name &name) : name_{name} {} virtual ~DerivedTypeSpec() = default; DerivedTypeSpec &AddParamValue(const ParamValue &value) { paramValues_.push_back(std::make_pair(std::nullopt, value)); @@ -477,6 +477,12 @@ public: const std::list, ParamValue>> & paramValues() { return paramValues_; } + + // Provide access to the derived-type definition if is known + const DerivedTypeDef * definition() { + // TODO + return 0; + } private: const Name name_; -- 2.7.4