From: Stephane Chauveau Date: Thu, 12 Apr 2018 15:27:55 +0000 (+0200) Subject: [flang] add accessor to derived type definition X-Git-Tag: llvmorg-12-init~9537^2~2732 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccec5dde81b2dc4d9e598a0fe467808b158514ad;p=platform%2Fupstream%2Fllvm.git [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 --- 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_;