source: src/GenPoly/FindFunction.h @ 1761046

Last change on this file since 1761046 was b8b5535, checked in by Andrew Beach <ajbeach@…>, 8 months ago

Major round of clean-up in the GenPoly? directory.

  • Property mode set to 100644
File size: 1.3 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//
[b8b5535]7// FindFunction.h -- Find function types in a larger type.
[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
[b8b5535]18#include "GenPoly.h"            // for TypeVarMap
[08fc48f]19
[51b7345]20namespace GenPoly {
[c97b448]21
22typedef bool (*FindFunctionPred)( const ast::FunctionType *, const TypeVarMap & );
23
24/// Recursively walks `type`, placing all functions that match `predicate`
25/// under `typeVars` into `functions`.
26void findFunction( const ast::Type * type,
27                std::vector<ast::ptr<ast::FunctionType>> & functions,
28                const TypeVarMap & typeVars, FindFunctionPred predicate );
29/// Like findFunction, but also replaces the function type with `void ()(void)`.
30const ast::Type * findAndReplaceFunction( const ast::Type * type,
31                std::vector<ast::ptr<ast::FunctionType>> & functions,
32                const TypeVarMap & typeVars, FindFunctionPred predicate );
33
[51b7345]34} // namespace GenPoly
35
[51587aa]36// Local Variables: //
37// tab-width: 4 //
38// mode: c++ //
39// compile-command: "make install" //
40// End: //
Note: See TracBrowser for help on using the repository browser.