Changeset 89be1c68 for src/ResolvExpr/Cost.h
- Timestamp:
- Jul 17, 2017, 2:35:52 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 7ebaa56
- Parents:
- b46e3bd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Cost.h
rb46e3bd r89be1c68 21 21 namespace ResolvExpr { 22 22 class Cost { 23 public: 24 Cost(); 23 private: 25 24 Cost( int unsafeCost, int polyCost, int safeCost ); 26 25 27 void incUnsafe( int inc = 1 ); 28 void incPoly( int inc = 1 ); 29 void incSafe( int inc = 1 ); 26 public: 27 Cost & incUnsafe( int inc = 1 ); 28 Cost & incPoly( int inc = 1 ); 29 Cost & incSafe( int inc = 1 ); 30 30 31 31 Cost operator+( const Cost &other ) const; … … 50 50 }; 51 51 52 inline Cost::Cost() : unsafeCost( 0 ), polyCost( 0 ), safeCost( 0 ) {}53 54 52 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost ) : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ) {} 55 53 56 inline voidCost::incUnsafe( int inc ) {54 inline Cost & Cost::incUnsafe( int inc ) { 57 55 unsafeCost += inc; 56 return *this; 58 57 } 59 58 60 inline voidCost::incPoly( int inc ) {59 inline Cost & Cost::incPoly( int inc ) { 61 60 polyCost += inc; 61 return *this; 62 62 } 63 63 64 inline voidCost::incSafe( int inc ) {64 inline Cost & Cost::incSafe( int inc ) { 65 65 safeCost += inc; 66 return *this; 66 67 } 67 68
Note: See TracChangeset
for help on using the changeset viewer.