[flang] add accessor to derived type definition
authorStephane Chauveau <stephane@chauveau-central.net>
Thu, 12 Apr 2018 15:27:55 +0000 (17:27 +0200)
committerStephane Chauveau <stephane@chauveau-central.net>
Thu, 12 Apr 2018 15:27:55 +0000 (17:27 +0200)
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

index 9d2d19d..df9c7ce 100644 (file)
@@ -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<std::pair<std::optional<Name>, ParamValue>> & paramValues() {
     return paramValues_;
   } 
+  
+  // Provide access to the derived-type definition if is known   
+  const DerivedTypeDef * definition() { 
+    // TODO
+    return 0; 
+  }
 
 private:
   const Name name_;