Changes in src/ResolvExpr/PtrsCastable.cc [843054c2:4040425]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/PtrsCastable.cc
r843054c2 r4040425 10 10 // Created On : Sun May 17 11:48:00 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 11:51:17 201513 // Update Count : 212 // Last Modified On : Wed Mar 2 17:36:18 2016 13 // Update Count : 8 14 14 // 15 15 … … 36 36 virtual void visit(UnionInstType *inst); 37 37 virtual void visit(EnumInstType *inst); 38 virtual void visit( ContextInstType *inst);38 virtual void visit(TraitInstType *inst); 39 39 virtual void visit(TypeInstType *inst); 40 40 virtual void visit(TupleType *tupleType); 41 virtual void visit(VarArgsType *varArgsType); 41 42 private: 42 43 Type *dest; … … 115 116 116 117 void PtrsCastable::visit(EnumInstType *inst) { 117 if ( dynamic_cast< EnumInstType* >( inst ) ) {118 if ( dynamic_cast< EnumInstType* >( dest ) ) { 118 119 result = 1; 119 } else if ( BasicType *bt = dynamic_cast< BasicType* >( inst ) ) {120 } else if ( BasicType *bt = dynamic_cast< BasicType* >( dest ) ) { 120 121 if ( bt->get_kind() == BasicType::SignedInt ) { 121 122 result = 0; … … 128 129 } 129 130 130 void PtrsCastable::visit( ContextInstType *inst) {131 void PtrsCastable::visit(TraitInstType *inst) { 131 132 // I definitely don't think we should be doing anything here 132 133 } 133 134 134 135 void PtrsCastable::visit(TypeInstType *inst) { 135 result = objectCast( inst, env, indexer ) && objectCast( dest, env, indexer )? 1 : -1;136 result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1; 136 137 } 137 138 138 139 void PtrsCastable::visit(TupleType *tupleType) { 140 result = objectCast( dest, env, indexer ); 141 } 142 143 void PtrsCastable::visit(VarArgsType *varArgsType) { 139 144 result = objectCast( dest, env, indexer ); 140 145 }
Note:
See TracChangeset
for help on using the changeset viewer.