Changeset 16ba4a6 for src/AST


Ignore:
Timestamp:
Nov 10, 2020, 12:20:37 AM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
18f0b70
Parents:
3febb2d
Message:

factor out resolver calls in pre-resolution stage

Location:
src/AST
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r3febb2d r16ba4a6  
    27642764                        old->location,
    27652765                        GET_ACCEPT_1(value, Expr),
    2766                         (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct
     2766                        (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::NoConstruct
    27672767                );
    27682768        }
     
    27732773                        GET_ACCEPT_V(initializers, Init),
    27742774                        GET_ACCEPT_V(designations, Designation),
    2775                         (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct
     2775                        (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::NoConstruct
    27762776                );
    27772777        }
  • src/AST/Decl.hpp

    r3febb2d r16ba4a6  
    7979        ptr<Expr> asmName;
    8080        bool isDeleted = false;
     81        bool isTypeFixed = false;
    8182
    8283        DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage,
  • src/AST/Init.hpp

    r3febb2d r16ba4a6  
    5050
    5151/// Flag for whether to construct from initialzier
    52 enum ConstructFlag { DoConstruct, MaybeConstruct };
     52enum ConstructFlag { NoConstruct, MaybeConstruct };
    5353
    5454/// Object initializer base class
     
    7171        ptr<Expr> value;
    7272
    73         SingleInit( const CodeLocation & loc, const Expr * val, ConstructFlag mc = DoConstruct )
     73        SingleInit( const CodeLocation & loc, const Expr * val, ConstructFlag mc = NoConstruct )
    7474        : Init( loc, mc ), value( val ) {}
    7575
     
    9090
    9191        ListInit( const CodeLocation & loc, std::vector<ptr<Init>> && is,
    92                 std::vector<ptr<Designation>> && ds = {}, ConstructFlag mc = DoConstruct );
     92                std::vector<ptr<Designation>> && ds = {}, ConstructFlag mc = NoConstruct );
    9393
    9494        using iterator = std::vector<ptr<Init>>::iterator;
     
    118118        ConstructorInit(
    119119                const CodeLocation & loc, const Stmt * ctor, const Stmt * dtor, const Init * init )
    120         : Init( loc, DoConstruct ), ctor( ctor ), dtor( dtor ), init( init ) {}
     120        : Init( loc, MaybeConstruct ), ctor( ctor ), dtor( dtor ), init( init ) {}
    121121
    122122        const Init * accept( Visitor & v ) const override { return v.visit( this ); }
  • src/AST/Pass.impl.hpp

    r3febb2d r16ba4a6  
    683683                // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
    684684                auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
    685                         if ( enterScope ) __pass::symtab::enter(core, 0);
     685                        if ( enterScope ) {
     686                                __pass::symtab::enter(core, 0);
     687                                __pass::scope::enter(core, 0);
     688                        }
    686689                }, [this, leaveScope = !this->atFunctionTop]() {
    687                         if ( leaveScope ) __pass::symtab::leave(core, 0);
     690                        if ( leaveScope ) {
     691                                __pass::symtab::leave(core, 0);
     692                                __pass::scope::leave(core, 0);
     693                        }
    688694                });
    689695                ValueGuard< bool > guard2( atFunctionTop );
  • src/AST/Type.cpp

    r3febb2d r16ba4a6  
    211211        for ( const Type * ty : types ) {
    212212                members.emplace_back( new ObjectDecl{
    213                         CodeLocation{}, "", ty, new ListInit( CodeLocation{}, {}, {}, MaybeConstruct ),
     213                        CodeLocation{}, "", ty, new ListInit( CodeLocation{}, {}, {}, NoConstruct ),
    214214                        Storage::Classes{}, Linkage::Cforall } );
    215215        }
Note: See TracChangeset for help on using the changeset viewer.