diff options
author | ajreynol <andrew.j.reynolds@gmail.com> | 2015-09-11 15:16:12 +0200 |
---|---|---|
committer | ajreynol <andrew.j.reynolds@gmail.com> | 2015-09-11 15:16:12 +0200 |
commit | ace360b4da1edef06088a366dc21b58f9431efc2 (patch) | |
tree | 31c3ae838314fbe97cf1e2de45b8422f55b55f9d /src/expr | |
parent | 07504bdc61fe1d18af2fabe56fcee89e531b033c (diff) |
Minor cleanup related to codatatypes.
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/type_node.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/expr/type_node.h b/src/expr/type_node.h index 4f9e497ea..0f5e020d8 100644 --- a/src/expr/type_node.h +++ b/src/expr/type_node.h @@ -582,6 +582,9 @@ public: /** Is this a parameterized datatype type */ bool isParametricDatatype() const; + /** Is this a codatatype type */ + bool isCodatatype() const; + /** Is this a fully instantiated datatype type */ bool isInstantiatedDatatype() const; @@ -985,6 +988,15 @@ inline bool TypeNode::isParametricDatatype() const { ( isPredicateSubtype() && getSubtypeParentType().isParametricDatatype() ); } +/** Is this a codatatype type */ +inline bool TypeNode::isCodatatype() const { + if( isDatatype() ){ + return getDatatype().isCodatatype(); + }else{ + return false; + } +} + /** Is this a constructor type */ inline bool TypeNode::isConstructor() const { return getKind() == kind::CONSTRUCTOR_TYPE; @@ -1004,7 +1016,7 @@ inline bool TypeNode::isTester() const { and <code>sig</code> significand bits */ inline bool TypeNode::isFloatingPoint(unsigned exp, unsigned sig) const { return - ( getKind() == kind::FLOATINGPOINT_TYPE && + ( getKind() == kind::FLOATINGPOINT_TYPE && getConst<FloatingPointSize>().exponent() == exp && getConst<FloatingPointSize>().significand() == sig ) || ( isPredicateSubtype() && getSubtypeParentType().isFloatingPoint(exp,sig) ); |