Changeset 0dd3a2f for translator/SynTree/AggregateDecl.cc
- Timestamp:
- May 18, 2015, 11:20:23 AM (9 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:
- 51587aa
- Parents:
- a32b204
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/AggregateDecl.cc
ra32b204 r0dd3a2f 1 /* 2 * This file is part of the Cforall project 3 * 4 * $Id: AggregateDecl.cc,v 1.7 2005/08/29 20:59:25 rcbilson Exp $ 5 * 6 */ 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 // AggregateDecl.cc -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Sun May 17 23:56:39 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 07:48:23 2015 13 // Update Count : 4 14 // 7 15 8 16 #include "Declaration.h" … … 11 19 12 20 13 AggregateDecl::AggregateDecl( const std::string &name ) 14 : Parent( name, Declaration::NoStorageClass, LinkageSpec::Cforall ) 15 { 21 AggregateDecl::AggregateDecl( const std::string &name ) : Parent( name, Declaration::NoStorageClass, LinkageSpec::Cforall ) { 16 22 } 17 23 18 AggregateDecl::AggregateDecl( const AggregateDecl &other ) 19 : Parent( other ) 20 { 24 AggregateDecl::AggregateDecl( const AggregateDecl &other ) : Parent( other ) { 21 25 cloneAll( other.members, members ); 22 26 cloneAll( other.parameters, parameters ); 23 27 } 24 28 25 AggregateDecl::~AggregateDecl() 26 { 29 AggregateDecl::~AggregateDecl() { 27 30 deleteAll( members ); 28 31 deleteAll( parameters ); 29 32 } 30 33 31 void 32 AggregateDecl::print( std::ostream &os, int indent ) const 33 { 34 void AggregateDecl::print( std::ostream &os, int indent ) const { 34 35 using std::string; 35 36 using std::endl; … … 37 38 os << typeString() << " " << get_name(); 38 39 if ( ! parameters.empty() ) { 39 os << endl << string( indent+2, ' ' ) << "with parameters" << endl;40 printAll( parameters, os, indent+4 );41 } 40 os << endl << string( indent+2, ' ' ) << "with parameters" << endl; 41 printAll( parameters, os, indent+4 ); 42 } // if 42 43 if ( ! members.empty() ) { 43 os << endl << string( indent+2, ' ' ) << "with members" << endl;44 printAll( members, os, indent+4 );45 } 44 os << endl << string( indent+2, ' ' ) << "with members" << endl; 45 printAll( members, os, indent+4 ); 46 } // if 46 47 } 47 48 48 void 49 AggregateDecl::printShort( std::ostream &os, int indent ) const 50 { 49 void AggregateDecl::printShort( std::ostream &os, int indent ) const { 51 50 using std::string; 52 51 using std::endl; … … 54 53 os << typeString() << " " << get_name(); 55 54 if ( ! parameters.empty() ) { 56 os << endl << string( indent+2, ' ' ) << "with parameters" << endl;57 printAll( parameters, os, indent+4 );58 } 55 os << endl << string( indent+2, ' ' ) << "with parameters" << endl; 56 printAll( parameters, os, indent+4 ); 57 } // if 59 58 } 60 59 … … 67 66 std::string ContextDecl::typeString() const { return "context"; } 68 67 68 // Local Variables: // 69 // tab-width: 4 // 70 // mode: c++ // 71 // compile-command: "make install" // 72 // End: //
Note: See TracChangeset
for help on using the changeset viewer.