Changeset 0690350 for src/GenPoly/Box.cc


Ignore:
Timestamp:
Jan 12, 2018, 4:57:40 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1a4bef3
Parents:
bd0b6b62
git-author:
Rob Schluntz <rschlunt@…> (01/12/18 15:24:25)
git-committer:
Rob Schluntz <rschlunt@…> (01/12/18 16:57:40)
Message:

Minor code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rbd0b6b62 r0690350  
    302302        Expression *makeOp( const std::string &name, Expression *arg ) {
    303303                UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) );
    304                 expr->get_args().push_back( arg );
     304                expr->args.push_back( arg );
    305305                return expr;
    306306        }
     
    309309        Expression *makeOp( const std::string &name, Expression *lhs, Expression *rhs ) {
    310310                UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) );
    311                 expr->get_args().push_back( lhs );
    312                 expr->get_args().push_back( rhs );
     311                expr->args.push_back( lhs );
     312                expr->args.push_back( rhs );
    313313                return expr;
    314314        }
     
    316316        /// Returns the dereference of a local pointer variable
    317317        Expression *derefVar( ObjectDecl *var ) {
    318                 return makeOp( "*?", new VariableExpr( var ) );
     318                return UntypedExpr::createDeref( new VariableExpr( var ) );
    319319        }
    320320
     
    831831                                if ( ! isPolyType( arg->get_type() ) ) {
    832832                                        UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
    833                                         deref->get_args().push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) );
    834                                         deref->set_result( arg->get_type()->clone() );
     833                                        deref->args.push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) );
     834                                        deref->result = arg->get_type()->clone();
    835835                                        return deref;
    836836                                } // if
Note: See TracChangeset for help on using the changeset viewer.