Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    re612146c r135b431  
    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:46:44 2017
    13 // Update Count     : 68
     12// Last Modified On : Thu Aug 17 16:17:20 2017
     13// Update Count     : 67
    1414//
    1515
     
    5252
    5353
    54 AsmStmt::AsmStmt( std::list<Label> labels, bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ) : Statement( labels ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {}
     54AsmStmt::AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ) : Statement( labels ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {}
    5555
    5656AsmStmt::AsmStmt( const AsmStmt & other ) : Statement( other ), voltile( other.voltile ), instruction( maybeClone( other.instruction ) ), gotolabels( other.gotolabels ) {
     
    8989
    9090BranchStmt::BranchStmt( std::list<Label> labels, Label target, Type type ) throw ( SemanticError ) :
    91         Statement( labels ), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) {
     91        Statement( labels ), originalTarget( target ), target( target ), computedTarget( NULL ), type( type ) {
    9292        //actually this is a syntactic error signaled by the parser
    93         if ( type == BranchStmt::Goto && target.empty() ) {
     93        if ( type == BranchStmt::Goto && target.empty() )
    9494                throw SemanticError("goto without target");
    95         }
    9695}
    9796
    9897BranchStmt::BranchStmt( std::list<Label> labels, Expression *computedTarget, Type type ) throw ( SemanticError ) :
    9998        Statement( labels ), computedTarget( computedTarget ), type( type ) {
    100         if ( type != BranchStmt::Goto || computedTarget == nullptr ) {
     99        if ( type != BranchStmt::Goto || computedTarget == 0 )
    101100                throw SemanticError("Computed target not valid in branch statement");
    102         }
    103101}
    104102
    105103void BranchStmt::print( std::ostream &os, int indent ) const {
    106104        os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ;
    107         if ( target != "" ) os << string( indent+2, ' ' ) << "with target: " << target << endl;
    108         if ( originalTarget != "" ) os << string( indent+2, ' ' ) << "with original target: " << originalTarget << endl;
    109         if ( computedTarget != nullptr ) os << string( indent+2, ' ' ) << "with computed target: " << computedTarget << endl;
    110105}
    111106
Note: See TracChangeset for help on using the changeset viewer.