Changeset d41280e for src/GenPoly/GenPoly.h
- Timestamp:
- Feb 8, 2016, 10:07:42 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:
- c44e622
- Parents:
- 00ede9e (diff), bd85400 (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
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/GenPoly.h
r00ede9e rd41280e 20 20 #include <string> 21 21 #include <iostream> 22 #include <utility> 22 23 23 24 #include "SynTree/Declaration.h" 25 #include "SynTree/Type.h" 24 26 #include "SynTree/TypeSubstitution.h" 25 27 … … 32 34 33 35 /// true iff function has polymorphic return type 34 bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ); 35 bool isPolyRet( FunctionType *function, std::string &name ); 36 bool isPolyRet( FunctionType *function, const TyVarMap &otherTyVars ); 36 ReferenceToType *isPolyRet( FunctionType *function ); 37 37 38 38 /// returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided … … 48 48 Type *isPolyPtr( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 ); 49 49 50 /// if the base type (after dereferencing N >= 0 pointers) is a polymorphic type, returns the base type, NULL otherwise; 51 /// N will be stored in levels, if provided, will look up substitution in env if provided 52 Type *hasPolyBase( Type *type, int *levels = 0, const TypeSubstitution *env = 0 ); 53 54 /// if the base type (after dereferencing N >= 0 pointers) is a polymorphic type in tyVars, returns the base type, NULL otherwise; 55 /// N will be stored in levels, if provided, will look up substitution in env if provided 56 Type *hasPolyBase( Type *type, const TyVarMap &tyVars, int *levels = 0, const TypeSubstitution *env = 0 ); 57 50 58 /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise 51 FunctionType * 59 FunctionType *getFunctionType( Type *ty ); 52 60 61 /// If expr (after dereferencing N >= 0 pointers) is a variable expression, returns the variable expression, NULL otherwise; 62 /// N will be stored in levels, if provided 63 VariableExpr *getBaseVar( Expression *expr, int *levels = 0 ); 64 65 /// Adds the declarations in the forall list of type (and its pointed-to type if it's a pointer type) to `tyVarMap` 66 void makeTyVarMap( Type *type, TyVarMap &tyVarMap ); 67 53 68 /// Prints type variable map 54 69 void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap ); … … 59 74 /// Gets the name of the alignof parameter for the type 60 75 std::string alignofName( Type *ty ); 76 77 /// Gets the name of the offsetof parameter for the type 78 std::string offsetofName( Type *ty ); 61 79 } // namespace GenPoly 62 80
Note:
See TracChangeset
for help on using the changeset viewer.