Ignore:
Timestamp:
Jul 30, 2015, 4:05:02 PM (9 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, string, with_gc
Children:
e01559c
Parents:
51b986f
Message:

simplified label fixer code => no longer rename and consolidate labels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelFixer.h

    r51b986f re766208  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun 29 17:24:39 2015
    13 // Update Count     : 29
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 28 13:09:02 2015
     13// Update Count     : 31
    1414//
    1515
     
    6363                class Entry {
    6464                        public:
    65                         union UsageLoc {
    66                                 Statement * stmt;
    67                                 Expression * expr;
    68 
    69                                 void accept( Visitor &visitor );
    70                         };
    71 
    7265                        Entry( Statement *to ) : definition( to ) {}
    73                         Entry( Statement *to, Statement *from );
    74                         Entry( Statement *to, Expression *from );
    75                         bool used() { return ( usage.empty() ); }
    7666                        bool defined() { return ( definition != 0 ); }
    7767                        bool insideLoop();
     
    8373                        void set_definition( Statement *def ) { definition = def; }
    8474
    85                         std::list< UsageLoc > &get_uses() { return usage; }
    86                         void add_use( Statement *use ) {
    87                                 UsageLoc loc;
    88                                 loc.stmt = use;
    89                                 usage.push_back( loc );
    90                         }
    91                         void add_use( Expression *use ) {
    92                                 UsageLoc loc;
    93                                 loc.expr = use;
    94                                 usage.push_back( loc );                                 
    95                         }
    96 
    97                         void add_uses ( Entry &other ) { usage.insert( usage.end(), other.usage.begin(), other.usage.end() ); }
    9875                  private:
    9976                        Label label; 
    10077                        Statement *definition;
    101                         std::list<UsageLoc> usage;
    10278                };
    10379                 
    10480                std::map < Label, Entry *> labelTable;
    10581                LabelGenerator *generator;
    106                 Statement * currentStatement;
    10782        };
    10883} // namespace ControlStruct
Note: See TracChangeset for help on using the changeset viewer.