Changeset ff29f08 for src/CodeGen


Ignore:
Timestamp:
May 18, 2018, 2:09:21 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
2472a19
Parents:
f6f0cca3 (diff), c7d8100c (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.
Message:

Merge remote-tracking branch 'origin/master' into with_gc

Location:
src/CodeGen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rf6f0cca3 rff29f08  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep  3 20:42:52 2017
    13 // Update Count     : 490
     12// Last Modified On : Sat May  5 09:08:32 2018
     13// Update Count     : 494
    1414//
    1515#include "CodeGenerator.h"
     
    370370
    371371        void CodeGenerator::postvisit( Constant * constant ) {
    372                 output << constant->get_value() ;
     372                output << constant->get_value();
    373373        }
    374374
     
    587587                output << "(";
    588588                if ( castExpr->get_result()->isVoid() ) {
    589                         output << "(void)" ;
     589                        output << "(void)";
    590590                } else {
    591591                        // at least one result type of cast.
     
    878878                        } // for
    879879                } // if
    880                 output << " );" ;
     880                output << " );";
    881881        }
    882882
     
    886886                output << "( ";
    887887                if ( asmStmt->get_instruction() ) asmStmt->get_instruction()->accept( *visitor );
    888                 output << " )" ;
     888                output << " )";
     889        }
     890
     891        void CodeGenerator::postvisit( DirectiveStmt * dirStmt ) {
     892                output << endl << dirStmt->directive;                   // endl prevents spaces before directive
    889893        }
    890894
     
    903907
    904908        void CodeGenerator::postvisit( SwitchStmt * switchStmt ) {
    905                 output << "switch ( " ;
     909                output << "switch ( ";
    906910                switchStmt->get_condition()->accept( *visitor );
    907911                output << " ) ";
     
    929933                ++indent;
    930934                for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end();  i++) {
    931                         output << indent << printLabels( (*i)->get_labels() )  ;
     935                        output << indent << printLabels( (*i)->get_labels() ) ;
    932936                        (*i)->accept( *visitor );
    933937                        output << endl;
     
    10661070        void CodeGenerator::postvisit( WhileStmt * whileStmt ) {
    10671071                if ( whileStmt->get_isDoWhile() ) {
    1068                         output << "do" ;
    1069                 } else {
    1070                         output << "while (" ;
     1072                        output << "do";
     1073                } else {
     1074                        output << "while (";
    10711075                        whileStmt->get_condition()->accept( *visitor );
    10721076                        output << ")";
     
    10801084
    10811085                if ( whileStmt->get_isDoWhile() ) {
    1082                         output << " while (" ;
     1086                        output << " while (";
    10831087                        whileStmt->get_condition()->accept( *visitor );
    10841088                        output << ");";
  • src/CodeGen/CodeGenerator.h

    rf6f0cca3 rff29f08  
    9999                void postvisit( ExprStmt * );
    100100                void postvisit( AsmStmt * );
     101                void postvisit( DirectiveStmt * );
    101102                void postvisit( AsmDecl * );                            // special: statement in declaration context
    102103                void postvisit( IfStmt * );
  • src/CodeGen/FixNames.cc

    rf6f0cca3 rff29f08  
    5555                auto && name = SymTab::Mangler::mangle( mainDecl );
    5656                // std::cerr << name << std::endl;
    57                 return name;
     57                return std::move(name);
    5858        }
    5959        std::string mangle_main_args() {
     
    7878                auto&& name = SymTab::Mangler::mangle( mainDecl );
    7979                // std::cerr << name << std::endl;
    80                 return name;
     80                return std::move(name);
    8181        }
    8282
Note: See TracChangeset for help on using the changeset viewer.