Ignore:
Timestamp:
May 18, 2015, 11:20:23 AM (9 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:
51587aa
Parents:
a32b204
Message:

licencing: third groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/ObjectDecl.cc

    ra32b204 r0dd3a2f  
     1//
     2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
     3//
     4// The contents of this file are covered under the licence agreement in the
     5// file "LICENCE" distributed with Cforall.
     6//
     7// ObjectDecl.cc --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Mon May 18 07:44:20 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon May 18 10:14:18 2015
     13// Update Count     : 2
     14//
     15
    116#include "Declaration.h"
    217#include "Type.h"
     
    520#include "utility.h"
    621
    7 
    822ObjectDecl::ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init )
    9     : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
     23        : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
    1024}
    1125
    1226ObjectDecl::ObjectDecl( const ObjectDecl &other )
    13     : Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ) {
     27        : Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ) {
    1428}
    1529
    1630ObjectDecl::~ObjectDecl() {
    17     delete type;
    18     delete init;
    19     delete bitfieldWidth;
     31        delete type;
     32        delete init;
     33        delete bitfieldWidth;
    2034}
    2135
    2236void ObjectDecl::print( std::ostream &os, int indent ) const {
    23     if ( get_name() != "" ) {
    24         os << get_name() << ": a ";
    25     }
     37        if ( get_name() != "" ) {
     38                os << get_name() << ": a ";
     39        } // if
    2640
    27     if ( get_linkage() != LinkageSpec::Cforall ) {
    28         os << LinkageSpec::toString( get_linkage() ) << " ";
    29     }
     41        if ( get_linkage() != LinkageSpec::Cforall ) {
     42                os << LinkageSpec::toString( get_linkage() ) << " ";
     43        } // if
    3044
    31     if ( get_storageClass() != NoStorageClass ) {
    32         os << storageClassName[ get_storageClass() ] << ' ';
    33     }
     45        if ( get_storageClass() != NoStorageClass ) {
     46                os << storageClassName[ get_storageClass() ] << ' ';
     47        } // if
    3448
    35     if ( get_type() ) {
    36         get_type()->print( os, indent );
    37     } else {
    38         os << "untyped entity ";
    39     }
     49        if ( get_type() ) {
     50                get_type()->print( os, indent );
     51        } else {
     52                os << "untyped entity ";
     53        } // if
    4054
    41     if ( init ) {
    42         os << "with initializer ";
    43         init->print( os, indent );
    44     }
     55        if ( init ) {
     56                os << "with initializer ";
     57                init->print( os, indent );
     58        } // if
    4559
    46     if ( bitfieldWidth ) {
    47         os << "with bitfield width ";
    48         bitfieldWidth->print( os );
    49     }
     60        if ( bitfieldWidth ) {
     61                os << "with bitfield width ";
     62                bitfieldWidth->print( os );
     63        } // if
    5064}
    5165
    5266void ObjectDecl::printShort( std::ostream &os, int indent ) const {
    53     if ( get_name() != "" ) {
    54         os << get_name() << ": a ";
    55     }
     67        if ( get_name() != "" ) {
     68                os << get_name() << ": a ";
     69        } // if
    5670
    57     if ( get_storageClass() != NoStorageClass ) {
    58         os << storageClassName[ get_storageClass() ] << ' ';
    59     }
     71        if ( get_storageClass() != NoStorageClass ) {
     72                os << storageClassName[ get_storageClass() ] << ' ';
     73        } // if
    6074
    61     if ( get_type() ) {
    62         get_type()->print( os, indent );
    63     } else {
    64         os << "untyped entity ";
    65     }
     75        if ( get_type() ) {
     76                get_type()->print( os, indent );
     77        } else {
     78                os << "untyped entity ";
     79        } // if
    6680
    67     if ( bitfieldWidth ) {
    68         os << "with bitfield width ";
    69         bitfieldWidth->print( os );
    70     }
     81        if ( bitfieldWidth ) {
     82                os << "with bitfield width ";
     83                bitfieldWidth->print( os );
     84        } // if
    7185}
     86
     87// Local Variables: //
     88// tab-width: 4 //
     89// mode: c++ //
     90// compile-command: "make install" //
     91// End: //
Note: See TracChangeset for help on using the changeset viewer.