source: src/ResolvExpr/Unify.h @ e563edf

ADTast-experimental
Last change on this file since e563edf was e563edf, checked in by Andrew Beach <ajbeach@…>, 13 months ago

Header Clean-up: Clearing out typeops, moving things to Unify because that header already exist.

  • Property mode set to 100644
File size: 3.7 KB
Line 
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//
7// Unify.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 13:09:04 2015
11// Last Modified By : Andrew Beach
12// Last Modified On : Tue Jan 17 11:12:00 2023
13// Update Count     : 5
14//
15
16#pragma once
17
18#include <list>                   // for list
19
20#include "AST/Node.hpp"             // for ptr
21#include "AST/TypeEnvironment.hpp"  // for TypeEnvironment, AssertionSet, OpenVarSet
22#include "Common/utility.h"       // for deleteAll
23#include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data
24#include "TypeEnvironment.h"      // for AssertionSet, OpenVarSet
25#include "WidenMode.h"              // for WidenMode
26
27class Type;
28class TypeInstType;
29namespace SymTab {
30        class Indexer;
31}
32
33namespace ast {
34        class SymbolTable;
35        class Type;
36}
37
38namespace ResolvExpr {
39
40bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
41bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
42bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
43bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );
44
45bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
46bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
47
48inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
49        TypeEnvironment env;
50        return typesCompatible( t1, t2, indexer, env );
51}
52
53inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
54        TypeEnvironment env;
55        return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
56}
57
58bool unify(
59        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
60        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
61        ast::OpenVarSet & open, const ast::SymbolTable & symtab );
62
63bool unify(
64        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
65        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
66        ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );
67
68bool unifyExact(
69        const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env,
70        ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
71        WidenMode widen, const ast::SymbolTable & symtab );
72
73bool unifyInexact(
74        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
75        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
76        const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab,
77        ast::ptr<ast::Type> & common );
78
79bool typesCompatible(
80        const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
81        const ast::TypeEnvironment & env = {} );
82
83bool typesCompatibleIgnoreQualifiers(
84        const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
85        const ast::TypeEnvironment & env = {} );
86
87} // namespace ResolvExpr
88
89// Local Variables: //
90// tab-width: 4 //
91// mode: c++ //
92// compile-command: "make install" //
93// End: //
Note: See TracBrowser for help on using the repository browser.