Changes in src/Parser/StatementNode.cc [a025ea8:427854b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
ra025ea8 r427854b 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 24 04:20:55 202013 // Update Count : 3 8312 // Last Modified On : Sat Aug 4 09:39:25 2018 13 // Update Count : 363 14 14 // 15 15 … … 345 345 } // build_compound 346 346 347 // A single statement in a control structure is always converted to a compound statement so subsequent generated code348 // can be placed within this compound statement. Otherwise, code generation has to constantly check for a single349 // statement and wrap it into a compound statement to insert additional code. Hence, all control structures have a350 // conical form for code generation.351 StatementNode * maybe_build_compound( StatementNode * first ) {352 // Optimization: if the control-structure statement is a compound statement, do not wrap it.353 // e.g., if (...) {...} do not wrap the existing compound statement.354 if ( ! dynamic_cast<CompoundStmt *>( first->stmt.get() ) ) { // unique_ptr355 CompoundStmt * cs = new CompoundStmt();356 buildMoveList( first, cs->get_kids() );357 return new StatementNode( cs );358 } // if359 return first;360 } // maybe_build_compound361 362 347 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) { 363 348 std::list< Expression * > out, in;
Note:
See TracChangeset
for help on using the changeset viewer.