Changeset 083cf31 for src/GenPoly/GenPoly.h
- Timestamp:
- Jan 7, 2016, 11:28:48 AM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1e9d87b
- Parents:
- 267cb3d (diff), de91427b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/GenPoly/GenPoly.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/GenPoly.h
r267cb3d r083cf31 20 20 #include <string> 21 21 #include <iostream> 22 22 23 #include "SynTree/Declaration.h" 24 #include "SynTree/TypeSubstitution.h" 23 25 24 26 namespace GenPoly { 25 27 typedef std::map< std::string, TypeDecl::Kind > TyVarMap; 26 28 29 /// A function needs an adapter if it returns a polymorphic value or if any of its 30 /// parameters have polymorphic type 27 31 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVarr ); 32 33 /// true iff function has polymorphic return type 28 34 bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ); 29 35 bool isPolyRet( FunctionType *function, std::string &name ); 30 36 bool isPolyRet( FunctionType *function, const TyVarMap &otherTyVars ); 31 // bool isPolyFun( FunctionType *fun, const TyVarMap &tyVars );32 bool isPolyVal( Type *type, const TyVarMap &tyVars );33 37 34 // true if type variable or any number of pointers to type variable 35 bool isPolyObj( Type *type, const TyVarMap &tyVars ); 38 /// returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided 39 Type *isPolyType( Type *type, const TypeSubstitution *env = 0 ); 40 41 /// returns polymorphic type if is polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided 42 Type *isPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 ); 43 44 /// returns polymorphic type if is pointer to polymorphic type, NULL otherwise; will look up substitution in env if provided 45 Type *isPolyPtr( Type *type, const TypeSubstitution *env = 0 ); 46 47 /// returns polymorphic type if is pointer to polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided 48 Type *isPolyPtr( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 ); 49 50 /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise 51 FunctionType * getFunctionType( Type *ty ); 52 53 /// Prints type variable map 36 54 void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap ); 55 56 /// Gets the name of the sizeof parameter for the type 57 std::string sizeofName( Type *ty ); 58 59 /// Gets the name of the alignof parameter for the type 60 std::string alignofName( Type *ty ); 37 61 } // namespace GenPoly 38 62
Note:
See TracChangeset
for help on using the changeset viewer.