Ignore:
Timestamp:
Feb 8, 2016, 10:07:42 AM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' into gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.h

    r00ede9e rd41280e  
    2020#include <string>
    2121#include <iostream>
     22#include <utility>
    2223
    2324#include "SynTree/Declaration.h"
     25#include "SynTree/Type.h"
    2426#include "SynTree/TypeSubstitution.h"
    2527
     
    3234
    3335        /// 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 );
    3737
    3838        /// returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided
     
    4848        Type *isPolyPtr( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
    4949
     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
    5058        /// 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 );
     59        FunctionType *getFunctionType( Type *ty );
    5260
     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       
    5368        /// Prints type variable map
    5469        void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap );
     
    5974        /// Gets the name of the alignof parameter for the type
    6075        std::string alignofName( Type *ty );
     76
     77        /// Gets the name of the offsetof parameter for the type
     78        std::string offsetofName( Type *ty );
    6179} // namespace GenPoly
    6280
Note: See TracChangeset for help on using the changeset viewer.