ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since fd344aa was
89be1c68,
checked in by Rob Schluntz <rschlunt@…>, 7 years ago
|
Remove Cost constructors, use only named members
This change makes it easier to read code involving costs, since in almost every case, only a single part of the cost tuple is relevant. Furthermore, this change makes it much simpler to add another dimension to the cost tuple, since only Cost.h needs to be updated, rather than every location using the cost constructor.
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[a32b204] | 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 | // |
---|
[3c13c03] | 7 | // Alternative.h -- |
---|
[a32b204] | 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Sat May 16 23:45:43 2015 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
| 12 | // Last Modified On : Sat May 16 23:54:39 2015 |
---|
| 13 | // Update Count : 2 |
---|
[3c13c03] | 14 | // |
---|
[a32b204] | 15 | |
---|
| 16 | #ifndef ALTERNATIVE_H |
---|
| 17 | #define ALTERNATIVE_H |
---|
[51b7345] | 18 | |
---|
| 19 | #include <list> |
---|
| 20 | #include "SynTree/SynTree.h" |
---|
| 21 | #include "Cost.h" |
---|
| 22 | #include "TypeEnvironment.h" |
---|
| 23 | |
---|
| 24 | namespace ResolvExpr { |
---|
[a32b204] | 25 | struct Alternative; |
---|
| 26 | typedef std::list< Alternative > AltList; |
---|
[d9a0e76] | 27 | |
---|
[a32b204] | 28 | struct Alternative { |
---|
| 29 | Alternative(); |
---|
| 30 | Alternative( Expression *expr, const TypeEnvironment &env, const Cost &cost ); |
---|
| 31 | Alternative( Expression *expr, const TypeEnvironment &env, const Cost &cost, const Cost &cvtCost ); |
---|
| 32 | Alternative( const Alternative &other ); |
---|
| 33 | Alternative &operator=( const Alternative &other ); |
---|
[aefcc3b] | 34 | Alternative( Alternative && other ); |
---|
| 35 | Alternative &operator=( Alternative && other ); |
---|
[a32b204] | 36 | ~Alternative(); |
---|
[3c13c03] | 37 | |
---|
[a32b204] | 38 | void print( std::ostream &os, int indent = 0 ) const; |
---|
[3c13c03] | 39 | |
---|
[a32b204] | 40 | Cost cost; |
---|
| 41 | Cost cvtCost; |
---|
| 42 | Expression *expr; |
---|
| 43 | TypeEnvironment env; |
---|
| 44 | }; |
---|
[51b7345] | 45 | } // namespace ResolvExpr |
---|
| 46 | |
---|
[a32b204] | 47 | #endif // ALTERNATIVE_H |
---|
| 48 | |
---|
| 49 | // Local Variables: // |
---|
| 50 | // tab-width: 4 // |
---|
| 51 | // mode: c++ // |
---|
| 52 | // compile-command: "make install" // |
---|
| 53 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.