Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cc

    r7754cde r698664b3  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Sep 22 14:04:13 2015
    13 // Update Count     : 15
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Jun 13 15:54:07 2015
     13// Update Count     : 6
    1414//
    1515
     
    1717
    1818#include "Specialize.h"
    19 #include "GenPoly.h"
    2019#include "PolyMutator.h"
    2120
     
    8887        }
    8988
     89        /// Returns a pointer to the base FunctionType if ty is the type of a function (or pointer to one), NULL otherwise
     90        FunctionType * getFunctionType( Type *ty ) {
     91                PointerType *ptrType;
     92                if ( ( ptrType = dynamic_cast< PointerType* >( ty ) ) ) {
     93                        return dynamic_cast< FunctionType* >( ptrType->get_base() ); // pointer if FunctionType, NULL otherwise
     94                } else {
     95                        return dynamic_cast< FunctionType* >( ty ); // pointer if FunctionType, NULL otherwise
     96                }
     97        }
     98
    9099        /// Generates a thunk that calls `actual` with type `funType` and returns its address
    91100        Expression * Specialize::createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams ) {
     
    191200        Expression * Specialize::mutate( AddressExpr *addrExpr ) {
    192201                addrExpr->get_arg()->acceptMutator( *this );
    193                 assert( ! addrExpr->get_results().empty() );
    194202                addrExpr->set_arg( doSpecialization( addrExpr->get_results().front(), addrExpr->get_arg() ) );
    195203                return addrExpr;
Note: See TracChangeset for help on using the changeset viewer.