source: src/ResolvExpr/WidenMode.h @ f474e91

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since f474e91 was f474e91, checked in by Aaron Moss <a3moss@…>, 5 years ago

Port unification calculations to new AST

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[d286cf68]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// WidenMode.h --
8//
9// Author           : Aaron B. Moss
10// Created On       : Mon Jun 18 11:58:00 2018
11// Last Modified By : Aaron B. Moss
12// Last Modified On : Mon Jun 18 11:58:00 2018
13// Update Count     : 1
14//
15
16#pragma once
17
18namespace ResolvExpr {
19        struct WidenMode {
[f474e91]20                WidenMode( bool first, bool second ): first( first ), second( second ) {}
21               
22                WidenMode &operator|=( const WidenMode &other ) {
23                        first |= other.first; second |= other.second; return *this;
24                }
[d286cf68]25
[f474e91]26                WidenMode &operator&=( const WidenMode &other ) {
27                        first &= other.first; second &= other.second; return *this;
28                }
29
30                WidenMode operator|( const WidenMode &other ) {
31                        WidenMode newWM( *this ); newWM |= other; return newWM;
32                }
33
34                WidenMode operator&( const WidenMode &other ) {
35                        WidenMode newWM( *this ); newWM &= other; return newWM;
36                }
37               
38                operator bool() { return first && second; }
39
40                bool first : 1, second : 1;
[d286cf68]41        };
42} // namespace ResolvExpr
43
44// Local Variables: //
45// tab-width: 4 //
46// mode: c++ //
47// compile-command: "make install" //
48// End: //
Note: See TracBrowser for help on using the repository browser.