Changeset fc638d2


Ignore:
Timestamp:
Dec 13, 2016, 4:13:08 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
7933351
Parents:
f7e749f
Message:

fixed StmtExpr? code in PolyMutator?, added missing copy constructor, misc documentation

Location:
src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rf7e749f rfc638d2  
    281281                } // if
    282282                output << " }";
     283        }
     284
     285        void CodeGenerator::visit( ConstructorInit * init ){
     286                assertf( false, "ConstructorInit nodes should not make it to CodeGen." );
    283287        }
    284288
  • src/CodeGen/CodeGenerator.h

    rf7e749f rfc638d2  
    4747                virtual void visit( SingleInit * );
    4848                virtual void visit( ListInit * );
     49                virtual void visit( ConstructorInit * );
    4950
    5051                //*** Constant
  • src/GenPoly/CopyParams.cc

    rf7e749f rfc638d2  
    3838        };
    3939
     40        /// creates local copies of polymorphic function parameters
    4041        void copyParams( std::list< Declaration* > &translationUnit ) {
    4142                CopyParams copier;
     
    5354                        if ( ! modVars.empty() ) {
    5455                                std::map< std::string, DeclarationWithType* > assignOps;
     56                                // xxx - this needs to use constructors, not assignment operators
    5557                                // assume the assignment operator is the first assert param after any "type" parameter
    5658                                for ( Type::ForallList::const_iterator tyVar = funcDecl->get_functionType()->get_forall().begin(); tyVar != funcDecl->get_functionType()->get_forall().end(); ++tyVar ) {
  • src/GenPoly/PolyMutator.cc

    rf7e749f rfc638d2  
    149149                ValueGuard< std::list< Statement* > > oldStmtsToAdd( stmtsToAdd );
    150150                ValueGuard< std::list< Statement* > > oldStmtsToAddAfter( stmtsToAddAfter );
     151                ValueGuard< TypeSubstitution * > oldEnv( env );
    151152
    152                 // xxx - not sure if these are needed, along with appropriate assignments, but I don't think so...
    153                 // ValueGuard< TyVarMap > oldScopeTyVars;
    154                 // ValueGuard< TypeSubstitution * > oldEnv;
     153                // xxx - not sure if this is needed, along with appropriate reset, but I don't think so...
     154                // ValueGuard< TyVarMap > oldScopeTyVars( scopeTyVars );
    155155
    156156                stmtsToAdd.clear();
    157157                stmtsToAddAfter.clear();
     158                // scopeTyVars.clear();
    158159
    159                 stmtExpr->set_result( maybeMutate( stmtExpr->get_result(), *this ) );
    160                 stmtExpr->set_statements( maybeMutate( stmtExpr->get_statements(), *this ) );
    161                 return stmtExpr;
     160                return Parent::mutate( stmtExpr );
    162161        }
    163162
  • src/ResolvExpr/TypeEnvironment.cc

    rf7e749f rfc638d2  
    3232        //
    3333        // I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this comparator.
    34         bool AssertCompare::operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) {
     34        bool AssertCompare::operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const {
    3535                        // Objects are always less than functions
    3636                        if ( ObjectDecl * objectDecl1 = dynamic_cast< ObjectDecl * >( d1 ) ) {
  • src/ResolvExpr/TypeEnvironment.h

    rf7e749f rfc638d2  
    2929namespace ResolvExpr {
    3030        struct AssertCompare {
    31                 bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 );
     31                bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const;
    3232        };
    3333        typedef std::map< DeclarationWithType*, bool, AssertCompare > AssertionSet;
  • src/SymTab/Indexer.h

    rf7e749f rfc638d2  
    2525        class Indexer : public Visitor {
    2626          public:
    27                 Indexer( bool useDebug = false );
     27                explicit Indexer( bool useDebug = false );
    2828
    2929                Indexer( const Indexer &that );
  • src/SynTree/CompoundStmt.cc

    rf7e749f rfc638d2  
    4949                Statement * origStmt = *origit++;
    5050                if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) {
    51                         DeclStmt * origDeclStmt = dynamic_cast< DeclStmt * >( origStmt );
    52                         assert( origDeclStmt );
     51                        DeclStmt * origDeclStmt = safe_dynamic_cast< DeclStmt * >( origStmt );
    5352                        if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) {
    54                                 DeclarationWithType * origdwt = dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
    55                                 assert( origdwt );
     53                                DeclarationWithType * origdwt = safe_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
    5654                                assert( dwt->get_name() == origdwt->get_name() );
    5755                                declMap[ origdwt ] = dwt;
    58                         }
    59                 }
     56                        } else assert( ! dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ) );
     57                } else assert( ! dynamic_cast< DeclStmt * > ( s ) );
    6058        }
    6159        if ( ! declMap.empty() ) {
  • src/SynTree/Initializer.cc

    rf7e749f rfc638d2  
    6565}
    6666
     67ListInit::ListInit( const ListInit & other ) : Initializer( other ) {
     68        cloneAll( other.initializers, initializers );
     69        cloneAll( other.designators, designators );
     70}
     71
     72
    6773ListInit::~ListInit() {
    6874        deleteAll( initializers );
  • src/SynTree/Initializer.h

    rf7e749f rfc638d2  
    8888        ListInit( const std::list<Initializer*> &initializers,
    8989                          const std::list<Expression *> &designators = std::list< Expression * >(), bool maybeConstructed = false );
     90        ListInit( const ListInit & other );
    9091        virtual ~ListInit();
    9192
  • src/SynTree/VarExprReplacer.cc

    rf7e749f rfc638d2  
    2121// replace variable with new node from decl map
    2222void VarExprReplacer::visit( VariableExpr * varExpr ) {
     23  // xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are)
    2324  if ( declMap.count( varExpr->get_var() ) ) {
    2425    varExpr->set_var( declMap.at( varExpr->get_var() ) );
Note: See TracChangeset for help on using the changeset viewer.