Ignore:
Timestamp:
Nov 15, 2014, 10:46:42 PM (10 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

reformat files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/FunctionType.cc

    r8c17ab0 rc8ffe20b  
    1 /*
    2  * This file is part of the Cforall project
    3  *
    4  * $Id: FunctionType.cc,v 1.8 2005/08/29 20:59:25 rcbilson Exp $
    5  *
    6  */
    7 
    81#include <algorithm>
    92
     
    136
    147
    15 FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs )
    16     : Type( tq ), isVarArgs( isVarArgs )
    17 {
     8FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs ) : Type( tq ), isVarArgs( isVarArgs ) {
    189}
    1910
    20 FunctionType::FunctionType( const FunctionType &other )
    21     : Type( other ), isVarArgs( other.isVarArgs )
    22 {
     11FunctionType::FunctionType( const FunctionType &other ) : Type( other ), isVarArgs( other.isVarArgs ) {
    2312    cloneAll( other.returnVals, returnVals );
    2413    cloneAll( other.parameters, parameters );
    2514}
    2615
    27 FunctionType::~FunctionType()
    28 {
     16FunctionType::~FunctionType() {
    2917    deleteAll( returnVals );
    3018    deleteAll( parameters );
    3119}
    3220
    33 void
    34 FunctionType::print( std::ostream &os, int indent ) const
    35 {
     21void FunctionType::print( std::ostream &os, int indent ) const {
    3622    using std::string;
    3723    using std::endl;
     
    3925    Type::print( os, indent );
    4026    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;
    4632        }
    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;
    4935    }
    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;
    5339    } else {
    5440        os << endl;
    55         printAll( returnVals, os, indent+4 );
     41        printAll( returnVals, os, indent + 4 );
    5642    }
    57 
    5843}
    5944
Note: See TracChangeset for help on using the changeset viewer.