Changeset 0b8cd722
- Timestamp:
- Jan 8, 2015, 2:37:47 PM (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:
- 6c3744e
- Parents:
- 17cd4eb
- Location:
- translator
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Parser/InitializerNode.cc
r17cd4eb r0b8cd722 20 20 21 21 InitializerNode::InitializerNode( InitializerNode *init, bool aggrp, ExpressionNode *des ) 22 :aggregate( aggrp ), designator( des ), kids( 0 ) {22 : expr( 0 ), aggregate( aggrp ), designator( des ), kids( 0 ) { 23 23 if ( init != 0 ) 24 24 set_link(init); -
translator/Parser/TypeData.cc
r17cd4eb r0b8cd722 33 33 function->body = 0; 34 34 function->hasBody = false; 35 function->newStyle = false; 35 36 break; 36 37 case Aggregate: -
translator/Parser/TypedefTable.cc
r17cd4eb r0b8cd722 106 106 void TypedefTable::leaveScope(void) { 107 107 debugPrint( "Leaving scope " << currentScope << endl ); 108 for (tableType::iterator i = table.begin(); i != table.end(); i++) {108 for (tableType::iterator i = table.begin(); i != table.end(); ) { 109 109 list<Entry> &declList = (*i).second; 110 110 while (!declList.empty() && declList.front().scope == currentScope) { 111 111 declList.pop_front(); 112 112 } 113 if ( declList.empty() ) { 114 table.erase( i );115 } 113 if ( declList.empty() ) { // standard idom for erasing during traversal 114 table.erase( i++ ); 115 } else ++i; 116 116 } 117 117 currentScope -= 1; -
translator/examples/swap.c
r17cd4eb r0b8cd722 4 4 5 5 forall( type T ) 6 Tswap( T *left, T *right ) {6 void swap( T *left, T *right ) { 7 7 T temp; 8 8 temp = *left; 9 9 *left = *right; 10 10 *right = temp; 11 return *right;12 11 } 13 12 … … 15 14 int x = 1, y = 2; 16 15 printf( "%d %d\n", x, y ); 17 int w; 18 w = swap( &x, &y ); 19 printf( "%d %d %d\n", w, x, y ); 16 swap( &x, &y ); 17 printf( "%d %d\n", x, y ); 20 18 } 21 19
Note: See TracChangeset
for help on using the changeset viewer.