#include <stdlib.h>#include <dirent.h>#include <fstream>#include <iostream>#include <string>#include <set>#include <vector>#include <libsherpa/INOstream.hxx>#include <libsherpa/EnumSet.hxx>#include "AST.hxx"#include "debug.hxx"#include "TvPrinter.hxx"#include "Environment.hxx"#include "TypeInfer.hxx"#include "Trail.hxx"#include "types.def"Go to the source code of this file.
Data Structures | |
| struct | comp |
| struct | ArrLen |
| struct | Type |
Defines | |
| #define | DEFTYPE(nm, prim, csimp, atom, scalar, ref, impint, impfloat) ty_##nm, |
| #define | DEFTYPE(nm, prim, csimp, atom, scalar, ref, impint, impfloat) ty_##nm, |
Typedefs | |
| typedef long long | TargetSWord |
| typedef sherpa::EnumSet< CompFlagValues > | CompFlagSet |
| typedef sherpa::EnumSet< MarkFlagValues > | MarkFlags |
| typedef sherpa::EnumSet< TypeFlagValues > | TypeFlags |
| typedef sherpa::EnumSet< PrintOptionValues > | PrintOptions |
| typedef std::less< boost::shared_ptr< Type > > | TypePtrLess |
| typedef std::set< boost::shared_ptr< Type >, TypePtrLess > | TypeSet |
Enumerations | |
| enum | TypeTag { nm, prim, csimp, atom, scalar, ref, impint, impfloat } |
| enum | CompFlagValues { COMP_NO_FLAGS = 0u, COMP_UNIN_DISCM = 0x01u, COMP_INVALID = 0x02u, COMP_BYREF = 0x04u, COMP_MAYBE_BYREF = 0x08u } |
| enum | MarkFlagValues { MARK_NONE = 0x0, MARK_PREDICATE = 0x0000001u, MARK_GET_BARE_TYPE = 0x0000002u, MARK_GET_THE_TYPE = 0x0000004u, MARK_SIZE = 0x0000008u, MARK_MANGLED_STRING = 0x0000010u, MARK_EMIT_ARR_VEC_FN_TYPES = 0x0000020u, MARK_CHECK_CONSTRAINTS = 0x0000040u, MARK_CHECK_MUT_CONSISTENCY = 0x0000080u, MARK_COLLECT_FTVS_WRT_GAMMA = 0x0000100u, MARK_COLLECT_ALL_FTVS = 0x0000200u, MARK_MAXIMIZE_MUTABILITY = 0x0000400u, MARK_MINIMIZE_MUTABILITY = 0x0000800u, MARK_MINIMIZE_DEEP_MUTABILITY = 0x0001000u, MARK_MIN_MUT_CONSTLESS = 0x0002000u, MARK_NORMALIZE_CONST = 0x0004000u, MARK_SIGN_MBS = 0x0008000u, MARK_ADJ_MAYBE = 0x0010000u, MARK_FIXUP_FN_TYPES = 0x0020000u, MARK_PROPAGATE_MUTABILITY = 0x0040000u, MARK_NORMALIZE_MBFULL = 0x0080000u, MARK_NORMALIZE_CONST_INPLACE = 0x0100000u, MARK_ENSURE_MINIMIZABILITY = 0x0200000u } |
| Mark values for types. More... | |
| enum | TypeFlagValues { TY_NO_FLAGS = 0x0, TY_CT_SUBSUMED = 0x01u, TY_CT_SELF = 0x02u, TY_RIGID = 0x04u, TY_CCC = 0x10u, TY_CLOS = 0x20u, TY_COERCE = 0x40u, TY_ARG_IN_CONST = 0x80u } |
| Definition for Type flags. More... | |
| enum | PrintOptionValues { PO_NO_FLAGS = 0x0, PO_NO_TRAVERSE = 0x01u, PO_SHOW_LINKS = 0x02u, PO_SHOW_FIELDS = 0x04u } |
Functions | |
| const char * | TypeTagName (TypeTag tt) |
| static int | operator< (const boost::shared_ptr< Type > &lhs, const boost::shared_ptr< Type > &rhs) |
| std::ostream & | operator<< (std::ostream &strm, Type &t) |
Variables | |
| const TypeFlags | TY_SP_MASK |
| #define DEFTYPE | ( | nm, | |||
| prim, | |||||
| csimp, | |||||
| atom, | |||||
| scalar, | |||||
| ref, | |||||
| impint, | |||||
| impfloat | ) | ty_##nm, |
| #define DEFTYPE | ( | nm, | |||
| prim, | |||||
| csimp, | |||||
| atom, | |||||
| scalar, | |||||
| ref, | |||||
| impint, | |||||
| impfloat | ) | ty_##nm, |
| typedef sherpa::EnumSet<CompFlagValues> CompFlagSet |
| typedef sherpa::EnumSet<MarkFlagValues> MarkFlags |
| typedef sherpa::EnumSet<PrintOptionValues> PrintOptions |
| typedef long long TargetSWord |
| typedef sherpa::EnumSet<TypeFlagValues> TypeFlags |
| typedef std::less<boost::shared_ptr<Type> > TypePtrLess |
| typedef std::set<boost::shared_ptr<Type>, TypePtrLess > TypeSet |
| enum CompFlagValues |
| enum MarkFlagValues |
Mark values for types.
The following marks are present on types to ensure that procedures that recurse over the structure of equi-recursive types do not recurse infinitely. We need to use differernt markers for procedures that are mutually recursive, or are otherwise used simultaneously. Here, we actually use different markers for each procedure that is recursive over type-structure, except for some simple self-recursive predicates which share the mark MARK_PREDICATE.
| enum PrintOptionValues |
| enum TypeFlagValues |
Definition for Type flags.
| TY_NO_FLAGS | |
| TY_CT_SUBSUMED | Typeclass constraint is subsumed by another (ex: by a derived class). |
| TY_CT_SELF | Typeclass constraint is due to self definition. |
| TY_RIGID | |
| TY_CCC |
Candidate for Copy-Compatibility.
This flag is for type variables that are in type argument position for structure or union types only. If set, it means that this type variable has not been captured within another reference type constructor, and the composite type is free to be copy-compatible at this position. |
| TY_CLOS | A temporary flag used in closure computation of FTVs in a TypeScheme. |
| TY_COERCE |
Flag used by adjMaybe to coerce only certain maybe-types.
This flag must be marked on maybe-Var()s. This flag is NOT cleared by the adjMaybe function. |
| TY_ARG_IN_CONST |
Flag used to fixup const types within composite data-structure definitons.
If an argument appears within a const type, it must be instantiated to a mb_Full type to ensure completeness of inference. This flag identifies all such type arguments to structure/union definitions that appear somewhere within a const type. |
| enum TypeTag |
| std::ostream& operator<< | ( | std::ostream & | strm, | |
| Type & | t | |||
| ) | [inline] |
| const char* TypeTagName | ( | TypeTag | tt | ) |
| const TypeFlags TY_SP_MASK |
Initial value:
(TypeFlags(TY_CT_SELF) | TY_RIGID | TY_CCC | TY_CLOS | TY_COERCE | TY_ARG_IN_CONST)
1.4.7