Changeset 871cdb4 for src


Ignore:
Timestamp:
Sep 7, 2017, 10:35:32 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
b3f252a
Parents:
234223f
Message:

Inlined some getters/setters in SynTree? and made some fields public, the goal being to remove getters at some point

Location:
src/SynTree
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r234223f r871cdb4  
    155155        virtual ~FunctionDecl();
    156156
    157         Type * get_type() const;
    158         virtual void set_type(Type *);
     157        Type * get_type() const { return type; }
     158        virtual void set_type(Type * t) { type = safe_dynamic_cast< FunctionType* >( t ); }
    159159
    160160        FunctionType * get_functionType() const { return type; }
  • src/SynTree/Expression.h

    r234223f r871cdb4  
    8484  public:
    8585        Expression * function;
     86        std::list<Expression *> args;
     87        InferredParams inferParams;
    8688
    8789        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
     
    98100        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    99101        virtual void print( std::ostream & os, int indent = 0 ) const;
    100 
    101   private:
    102         std::list<Expression *> args;
    103         InferredParams inferParams;
    104102};
    105103
  • src/SynTree/FunctionDecl.cc

    r234223f r871cdb4  
    4444        delete type;
    4545        delete statements;
    46 }
    47 
    48 Type * FunctionDecl::get_type() const {
    49         return type;
    50 }
    51 
    52 void FunctionDecl::set_type( Type *t ) {
    53         type = dynamic_cast< FunctionType* >( t );
    54         assert( type );
    5546}
    5647
  • src/SynTree/Statement.h

    r234223f r871cdb4  
    155155  public:
    156156        Expression * condition;
     157        std::list<Statement *> statements;
    157158
    158159        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
     
    170171        virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
    171172        virtual void print( std::ostream &os, int indent = 0 ) const;
    172   private:
    173         std::list<Statement *> statements;
     173
    174174};
    175175
     
    327327class TryStmt : public Statement {
    328328  public:
    329         CompoundStmt *block;
     329        CompoundStmt * block;
    330330        std::list<CatchStmt *> handlers;
    331         FinallyStmt *finallyBlock;
     331        FinallyStmt * finallyBlock;
    332332
    333333        TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
Note: See TracChangeset for help on using the changeset viewer.