Changes in src/ResolvExpr/Unify.cc [62e5546:a2a77af]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
r62e5546 ra2a77af 31 31 32 32 namespace ResolvExpr { 33 struct WidenMode {34 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}35 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }36 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }37 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }38 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }39 operator bool() { return widenFirst && widenSecond; }40 41 bool widenFirst : 1, widenSecond : 1;42 };43 33 44 34 class Unify : public Visitor { … … 597 587 } 598 588 589 // xxx - compute once and store in the FunctionType? 590 Type * extractResultType( FunctionType * function ) { 591 if ( function->get_returnVals().size() == 0 ) { 592 return new VoidType( Type::Qualifiers() ); 593 } else if ( function->get_returnVals().size() == 1 ) { 594 return function->get_returnVals().front()->get_type()->clone(); 595 } else { 596 TupleType * tupleType = new TupleType( Type::Qualifiers() ); 597 for ( DeclarationWithType * decl : function->get_returnVals() ) { 598 tupleType->get_types().push_back( decl->get_type()->clone() ); 599 } // for 600 return tupleType; 601 } 602 } 599 603 } // namespace ResolvExpr 600 604
Note: See TracChangeset
for help on using the changeset viewer.