source: src/GenPoly/FindFunction.h @ 4eebbcc

ADTast-experimental
Last change on this file since 4eebbcc was c97b448, checked in by Andrew Beach <ajbeach@…>, 21 months ago

Added some box pass utilities that I believe are working and I don't want to look at all the time.

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[51587aa]1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
[01aeade]7// FindFunction.h --
[51587aa]8//
9// Author           : Richard C. Bilson
10// Created On       : Mon May 18 07:44:20 2015
[c97b448]11// Last Modified By : Andrew Beach
12// Last Modified On : Fri Oct  7 10:30:00 2022
13// Update Count     : 3
[51587aa]14//
[51b7345]15
[6b0b624]16#pragma once
[51b7345]17
[08fc48f]18#include <list>       // for list
19
20#include "GenPoly.h"  // for TyVarMap
21
22class FunctionType;
23class Type;
[51b7345]24
25namespace GenPoly {
[01aeade]26        typedef bool (*FindFunctionPredicate)( FunctionType*, const TyVarMap& );
[51b7345]27
[f8b961b]28        /// recursively walk `type`, placing all functions that match `predicate` under `tyVars` into `functions`
[4da152a]29        void findFunction( Type *type, std::list< FunctionType const * > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate );
[f8b961b]30        /// like `findFunction`, but also replaces the function type with void ()(void)
[4da152a]31        void findAndReplaceFunction( Type *&type, std::list< FunctionType const * > &functions, const TyVarMap &tyVars, FindFunctionPredicate predicate );
[c97b448]32
33typedef bool (*FindFunctionPred)( const ast::FunctionType *, const TypeVarMap & );
34
35/// Recursively walks `type`, placing all functions that match `predicate`
36/// under `typeVars` into `functions`.
37void findFunction( const ast::Type * type,
38                std::vector<ast::ptr<ast::FunctionType>> & functions,
39                const TypeVarMap & typeVars, FindFunctionPred predicate );
40/// Like findFunction, but also replaces the function type with `void ()(void)`.
41const ast::Type * findAndReplaceFunction( const ast::Type * type,
42                std::vector<ast::ptr<ast::FunctionType>> & functions,
43                const TypeVarMap & typeVars, FindFunctionPred predicate );
44
[51b7345]45} // namespace GenPoly
46
[51587aa]47// Local Variables: //
48// tab-width: 4 //
49// mode: c++ //
50// compile-command: "make install" //
51// End: //
Note: See TracBrowser for help on using the repository browser.