Changeset daf1af8 for src/CodeGen


Ignore:
Timestamp:
Jun 8, 2017, 5:04:55 PM (8 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
cfaabe2c
Parents:
28762a1
Message:

Added a new ThrowStmt node to the Syntax Tree.

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r28762a1 rdaf1af8  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May 10 14:45:00 2017
    13 // Update Count     : 484
     12// Last Modified On : Thu Jun  8 16:00:00 2017
     13// Update Count     : 485
    1414//
    1515
     
    908908        }
    909909
     910        void CodeGenerator::visit( ThrowStmt * throwStmt ) {
     911                assertf( ! genC, "Throw statements should not reach code generation." );
     912
     913                output << ((throwStmt->get_kind() == ThrowStmt::Terminate) ?
     914                           "throw" : "throwResume");
     915                if (throwStmt->get_expr()) {
     916                        output << " ";
     917                        throwStmt->get_expr()->accept( *this );
     918                }
     919                if (throwStmt->get_target()) {
     920                        output << " _At ";
     921                        throwStmt->get_target()->accept( *this );
     922                }
     923                output << ";";
     924        }
     925
    910926        void CodeGenerator::visit( WhileStmt * whileStmt ) {
    911927                if ( whileStmt->get_isDoWhile() ) {
  • src/CodeGen/CodeGenerator.h

    r28762a1 rdaf1af8  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May 10 10:57:00 2017
    13 // Update Count     : 51
     12// Last Modified On : Thu Jun  8 15:48:00 2017
     13// Update Count     : 52
    1414//
    1515
     
    9191                virtual void visit( BranchStmt * );
    9292                virtual void visit( ReturnStmt * );
     93                virtual void visit( ThrowStmt * );
    9394                virtual void visit( WhileStmt * );
    9495                virtual void visit( ForStmt * );
Note: See TracChangeset for help on using the changeset viewer.