Changeset a16764a6 for src/ControlStruct


Ignore:
Timestamp:
Feb 28, 2018, 4:48:22 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
446ffa3
Parents:
6a8df56
Message:

Changed warning system to prepare for toggling warnings

Location:
src/ControlStruct
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptTranslate.cc

    r6a8df56 ra16764a6  
    572572                        // Pass.
    573573                } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) {
    574                         throw SemanticError(catchStmt->location, "catch must have exception type");
     574                        SemanticError(catchStmt->location, "catch must have exception type");
    575575                } else {
    576                         throw SemanticError(catchStmt->location, "catchResume must have exception type");
     576                        SemanticError(catchStmt->location, "catchResume must have exception type");
    577577                }
    578578
  • src/ControlStruct/LabelFixer.cc

    r6a8df56 ra16764a6  
    9292                        } else if ( labelTable[ l ]->defined() ) {
    9393                                // defined twice, error
    94                                 throw SemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() );
     94                                SemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() );
    9595                        }       else {
    9696                                // used previously, but undefined until now -> link with this entry
     
    117117
    118118        // Builds a table that maps a label to its defining statement.
    119         std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticError ) {
     119        std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticErrorException ) {
    120120                std::map< Label, Statement * > *ret = new std::map< Label, Statement * >();
    121121                for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) {
    122122                        if ( ! i->second->defined() ) {
    123                                 throw SemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() );
     123                                SemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() );
    124124                        }
    125125                        (*ret)[ i->first ] = i->second->get_definition();
  • src/ControlStruct/LabelFixer.h

    r6a8df56 ra16764a6  
    3333                LabelFixer( LabelGenerator *gen = 0 );
    3434
    35                 std::map < Label, Statement * > *resolveJumps() throw ( SemanticError );
     35                std::map < Label, Statement * > *resolveJumps() throw ( SemanticErrorException );
    3636
    3737                // Declarations
  • src/ControlStruct/MLEMutator.cc

    r6a8df56 ra16764a6  
    9898
    9999
    100         Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticError ) {
     100        Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ) {
    101101                std::string originalTarget = branchStmt->originalTarget;
    102102
     
    115115                                        } else {
    116116                                                // break target is outmost control structure
    117                                                 if ( enclosingControlStructures.empty() ) throw SemanticError( branchStmt->location, "'break' outside a loop, switch, or labelled block" );
     117                                                if ( enclosingControlStructures.empty() ) SemanticError( branchStmt->location, "'break' outside a loop, switch, or labelled block" );
    118118                                                targetEntry = enclosingControlStructures.rbegin();
    119119                                        } // if
     
    124124                                // ensure that selected target is valid
    125125                                if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! isLoop( targetEntry->get_controlStructure() ) ) ) {
    126                                         throw SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );
     126                                        SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );
    127127                                } // if
    128128                                break;
  • src/ControlStruct/MLEMutator.h

    r6a8df56 ra16764a6  
    3737
    3838                void premutate( CompoundStmt *cmpndStmt );
    39                 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticError );
     39                Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException );
    4040                void premutate( WhileStmt *whileStmt );
    4141                Statement * postmutate( WhileStmt *whileStmt );
  • src/ControlStruct/Mutate.cc

    r6a8df56 ra16764a6  
    1818
    1919#include "Common/PassVisitor.h"    // for mutateAll
    20 #include "Common/SemanticError.h"  // for SemanticError
    2120#include "ForExprMutator.h"        // for ForExprMutator
    2221#include "LabelFixer.h"            // for LabelFixer
Note: See TracChangeset for help on using the changeset viewer.