Changeset c8ffe20b for translator/SynTree/FunctionType.cc
- Timestamp:
- Nov 15, 2014, 10:46:42 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 1ead581
- Parents:
- 8c17ab0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/FunctionType.cc
r8c17ab0 rc8ffe20b 1 /*2 * This file is part of the Cforall project3 *4 * $Id: FunctionType.cc,v 1.8 2005/08/29 20:59:25 rcbilson Exp $5 *6 */7 8 1 #include <algorithm> 9 2 … … 13 6 14 7 15 FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs ) 16 : Type( tq ), isVarArgs( isVarArgs ) 17 { 8 FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs ) : Type( tq ), isVarArgs( isVarArgs ) { 18 9 } 19 10 20 FunctionType::FunctionType( const FunctionType &other ) 21 : Type( other ), isVarArgs( other.isVarArgs ) 22 { 11 FunctionType::FunctionType( const FunctionType &other ) : Type( other ), isVarArgs( other.isVarArgs ) { 23 12 cloneAll( other.returnVals, returnVals ); 24 13 cloneAll( other.parameters, parameters ); 25 14 } 26 15 27 FunctionType::~FunctionType() 28 { 16 FunctionType::~FunctionType() { 29 17 deleteAll( returnVals ); 30 18 deleteAll( parameters ); 31 19 } 32 20 33 void 34 FunctionType::print( std::ostream &os, int indent ) const 35 { 21 void FunctionType::print( std::ostream &os, int indent ) const { 36 22 using std::string; 37 23 using std::endl; … … 39 25 Type::print( os, indent ); 40 26 os << "function" << endl; 41 if ( !parameters.empty() ) {42 os << string( indent +2, ' ' ) << "with parameters" << endl;43 printAll( parameters, os, indent +4 );44 if ( isVarArgs ) {45 os << string( indent +4, ' ' ) << "and a variable number of other arguments" << endl;27 if ( ! parameters.empty() ) { 28 os << string( indent + 2, ' ' ) << "with parameters" << endl; 29 printAll( parameters, os, indent + 4 ); 30 if ( isVarArgs ) { 31 os << string( indent + 4, ' ' ) << "and a variable number of other arguments" << endl; 46 32 } 47 } else if ( isVarArgs ) {48 os << string( indent +4, ' ' ) << "accepting unspecified arguments" << endl;33 } else if ( isVarArgs ) { 34 os << string( indent + 4, ' ' ) << "accepting unspecified arguments" << endl; 49 35 } 50 os << string( indent +2, ' ' ) << "returning ";51 if ( returnVals.empty() ) {52 os << endl << string( indent +4, ' ' ) << "nothing " << endl;36 os << string( indent + 2, ' ' ) << "returning "; 37 if ( returnVals.empty() ) { 38 os << endl << string( indent + 4, ' ' ) << "nothing " << endl; 53 39 } else { 54 40 os << endl; 55 printAll( returnVals, os, indent +4 );41 printAll( returnVals, os, indent + 4 ); 56 42 } 57 58 43 } 59 44
Note: See TracChangeset
for help on using the changeset viewer.