Changeset 417117e for src/AST


Ignore:
Timestamp:
Jun 28, 2019, 3:50:21 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
03bf5c8
Parents:
55b6476
Message:

Assorted cleanup

Location:
src/AST
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r55b6476 r417117e  
    2020#include <vector>
    2121
     22#include "Eval.hpp"                // for call
    2223#include "GenericSubstitution.hpp"
    2324#include "Stmt.hpp"
     
    5152        assert( arg );
    5253
    53         UntypedExpr * ret = new UntypedExpr{
    54                 loc, new NameExpr{loc, "*?"}, std::vector<ptr<Expr>>{ ptr<Expr>{ arg } }
    55         };
     54        UntypedExpr * ret = call( loc, "*?", arg );
    5655        if ( const Type * ty = arg->result ) {
    5756                const Type * base = InitTweak::getPointerBase( ty );
     
    7473        assert( lhs && rhs );
    7574
    76         UntypedExpr * ret = new UntypedExpr{
    77                 loc, new NameExpr{loc, "?=?"}, std::vector<ptr<Expr>>{ ptr<Expr>{ lhs }, ptr<Expr>{ rhs } }
    78         };
     75        UntypedExpr * ret = call( loc, "?=?", lhs, rhs );
    7976        if ( lhs->result && rhs->result ) {
    8077                // if both expressions are typed, assumes that this assignment is a C bitwise assignment,
  • src/AST/Pass.impl.hpp

    r55b6476 r417117e  
    19201920                                guard_symtab guard { *this };
    19211921                                auto new_node = p.second->accept( *this );
    1922                                 if (new_node != p.second) mutated = false;
     1922                                if (new_node != p.second) mutated = true;
    19231923                                new_map.insert({ p.first, new_node });
    19241924                        }
     
    19361936                                guard_symtab guard { *this };
    19371937                                auto new_node = p.second->accept( *this );
    1938                                 if (new_node != p.second) mutated = false;
     1938                                if (new_node != p.second) mutated = true;
    19391939                                new_map.insert({ p.first, new_node });
    19401940                        }
  • src/AST/TypeSubstitution.cpp

    r55b6476 r417117e  
    183183                // bind type variables from generic type instantiations
    184184                if ( auto decl = type->aggr() ) {
    185                         const std::vector<ptr<TypeDecl>> &baseParameters =  decl->params;
    186                         if (! type->params.empty()) {
    187                                 for ( const TypeDecl * tyvar : baseParameters ) {
     185                        if ( ! type->params.empty() ) {
     186                                for ( const TypeDecl * tyvar : decl->params ) {
    188187                                        boundVars.insert( tyvar->name );
    189188                                } // for
Note: See TracChangeset for help on using the changeset viewer.