Ignore:
Timestamp:
Jun 16, 2016, 12:24:39 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
25296a3
Parents:
f4bc57c
Message:

change Label from a string typedef to a class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelFixer.cc

    rf4bc57c r0f8e4ac  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LabelFixer.cc -- 
     7// LabelFixer.cc --
    88//
    99// Author           : Rodolfo G. Esteves
     
    8686
    8787
    88         // sets the definition of the labelTable entry to be the provided 
     88        // sets the definition of the labelTable entry to be the provided
    8989        // statement for every label in the list parameter. Happens for every kind of statement
    9090        Label LabelFixer::setLabelsDef( std::list< Label > &llabel, Statement *definition ) {
     
    101101                        } else if ( labelTable[ *i ]->defined() ) {
    102102                                // defined twice, error
    103                                 throw SemanticError( "Duplicate definition of label: " + *i );
     103                                throw SemanticError( "Duplicate definition of label: " + (*i).get_name() );
    104104                        }       else {
    105105                                // used previously, but undefined until now -> link with this entry
     
    109109                } // for
    110110
    111                 // produce one of the labels attached to this statement to be 
     111                // produce one of the labels attached to this statement to be
    112112                // temporarily used as the canonical label
    113113                return labelTable[ llabel.front() ]->get_label();
     
    130130                for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) {
    131131                        if ( ! i->second->defined() ) {
    132                                 throw SemanticError( "Use of undefined label: " + i->first );
     132                                throw SemanticError( "Use of undefined label: " + i->first.get_name() );
    133133                        }
    134134                        (*ret)[ i->first ] = i->second->get_definition();
Note: See TracChangeset for help on using the changeset viewer.