Changeset 5f2f2d7 for src/SymTab


Ignore:
Timestamp:
Jun 8, 2015, 8:56:35 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
81419b5
Parents:
cd623a4
Message:

fix constant types, remove unnecessary string copying, work on regression testing, fix several memory leaks

Location:
src/SymTab
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    rcd623a4 r5f2f2d7  
    1010// Created On       : Sun May 17 21:40:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 16:50:47 2015
    13 // Update Count     : 3
     12// Last Modified On : Mon Jun  8 15:12:12 2015
     13// Update Count     : 8
    1414//
    1515
     
    160160                } else {
    161161                        printQualifiers( typeInst );
    162                         std::ostrstream numStream;
     162                        std::ostringstream numStream;
    163163                        numStream << varNum->second.first;
    164                         mangleName << (numStream.pcount() + 1);
    165164                        switch ( (TypeDecl::Kind )varNum->second.second ) {
    166165                          case TypeDecl::Any:
     
    174173                                break;
    175174                        } // switch
    176                         mangleName << std::string( numStream.str(), numStream.pcount() );
     175                        mangleName << numStream.str();
    177176                } // if
    178177        }
     
    220219                                        sub_mangler.varNums = varNums;
    221220                                        (*assert)->accept( sub_mangler );
    222                                         assertionNames.push_back( std::string( sub_mangler.mangleName.str(), sub_mangler.mangleName.pcount() ) );
     221                                        assertionNames.push_back( sub_mangler.mangleName.str() );
    223222                                } // for
    224223                        } // for
  • src/SymTab/Mangler.h

    rcd623a4 r5f2f2d7  
    1010// Created On       : Sun May 17 21:44:03 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 16:49:21 2015
    13 // Update Count     : 3
     12// Last Modified On : Mon Jun  8 14:47:14 2015
     13// Update Count     : 5
    1414//
    1515
     
    1717#define MANGLER_H
    1818
    19 #include <strstream>
     19#include <sstream>
    2020#include "SynTree/SynTree.h"
    2121#include "SynTree/Visitor.h"
     
    4343                virtual void visit( TupleType *tupleType );
    4444 
    45                 std::string get_mangleName() { return std::string( mangleName.str(), mangleName.pcount() ); }
     45                std::string get_mangleName() { return mangleName.str(); }
    4646          private:
    47                 std::ostrstream mangleName;
     47                std::ostringstream mangleName;
    4848                typedef std::map< std::string, std::pair< int, int > > VarMapType;
    4949                VarMapType varNums;
  • src/SymTab/Validate.cc

    rcd623a4 r5f2f2d7  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon May 25 14:27:15 2015
    13 // Update Count     : 21
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun  8 17:19:35 2015
     13// Update Count     : 22
    1414//
    1515
     
    651651
    652652        void addDecls( std::list< Declaration * > &declsToAdd, std::list< Statement * > &statements, std::list< Statement * >::iterator i ) {
    653                 if ( ! declsToAdd.empty() ) {
    654                         for ( std::list< Declaration * >::iterator decl = declsToAdd.begin(); decl != declsToAdd.end(); ++decl ) {
    655                                 statements.insert( i, new DeclStmt( noLabels, *decl ) );
    656                         } // for
    657                         declsToAdd.clear();
    658                 } // if
     653                for ( std::list< Declaration * >::iterator decl = declsToAdd.begin(); decl != declsToAdd.end(); ++decl ) {
     654                        statements.insert( i, new DeclStmt( noLabels, *decl ) );
     655                } // for
     656                declsToAdd.clear();
    659657        }
    660658
Note: See TracChangeset for help on using the changeset viewer.