Changeset aa99647
- Timestamp:
- Sep 11, 2015, 9:44:54 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:
- 32a1e5fd
- Parents:
- f60d997 (diff), 4550bcf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rf60d997 raa99647 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jul 27 14:40:06201513 // Update Count : 2 1811 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:33:52 2015 13 // Update Count : 222 14 14 // 15 15 … … 186 186 } 187 187 188 void CodeGenerator::printDesignators( std::list< Expression * > & designators ) { 189 typedef std::list< Expression * > DesignatorList; 190 if ( designators.size() == 0 ) return; 191 for ( DesignatorList::iterator iter = designators.begin(); iter != designators.end(); ++iter ) { 192 if ( NameExpr * nm = dynamic_cast< NameExpr * >( *iter ) ) { 193 // if expression is a name, then initializing aggregate member 194 output << "."; 195 (*iter)->accept( *this ); 196 } else { 197 // if not a simple name, it has to be a constant expression, i.e. an array designator 198 output << "["; 199 (*iter)->accept( *this ); 200 output << "]"; 201 } 202 } 203 output << " = "; 204 } 205 188 206 void CodeGenerator::visit( SingleInit *init ) { 207 printDesignators( init->get_designators() ); 189 208 init->get_value()->accept( *this ); 190 209 } 191 210 192 211 void CodeGenerator::visit( ListInit *init ) { 212 printDesignators( init->get_designators() ); 193 213 output << "{ "; 194 214 genCommaList( init->begin_initializers(), init->end_initializers() ); -
src/CodeGen/CodeGenerator.h
rf60d997 raa99647 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jul 24 13:34:47201513 // Update Count : 2 511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:27:14 2015 13 // Update Count : 27 14 14 // 15 15 … … 95 95 std::ostream &output; 96 96 97 void printDesignators( std::list< Expression * > & ); 97 98 static std::string printLabels ( std::list < Label > & ); 98 99 void handleStorageClass( Declaration *decl );
Note: See TracChangeset
for help on using the changeset viewer.