Ignore:
Timestamp:
Feb 11, 2022, 12:17:39 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
08e4e6a
Parents:
1f7dc61
Message:

Waitfor now resolves calls to get_monitor inside the resolver rather than after.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r1f7dc61 r6668a3e  
    11121112                }
    11131113
    1114                
     1114
    11151115        } // anonymous namespace
    11161116/// Establish post-resolver invariants for expressions
     
    11581158
    11591159        namespace {
    1160                
     1160
    11611161
    11621162                /// resolve `untyped` to the expression whose candidate satisfies `pred` with the
     
    19051905
    19061906                        clause2.target.args.reserve( clause.target.args.size() );
     1907                        const ast::StructDecl * decl_monitor = symtab.lookupStruct( "monitor$" );
    19071908                        for ( auto arg : argsCandidates.front() ) {
    1908                                 clause2.target.args.emplace_back( std::move( arg->expr ) );
     1909                                const auto & loc = stmt->location;
     1910
     1911                                ast::Expr * init = new ast::CastExpr( loc,
     1912                                        new ast::UntypedExpr( loc,
     1913                                                new ast::NameExpr( loc, "get_monitor" ),
     1914                                                { arg->expr }
     1915                                        ),
     1916                                        new ast::PointerType(
     1917                                                new ast::StructInstType(
     1918                                                        decl_monitor
     1919                                                )
     1920                                        )
     1921                                );
     1922
     1923                                clause2.target.args.emplace_back( findSingleExpression( init, symtab ) );
    19091924                        }
    19101925
     
    20772092                if (auto functionDecl = decl.as<ast::FunctionDecl>()) {
    20782093                        // xxx - can intrinsic gen ever fail?
    2079                         if (functionDecl->linkage == ast::Linkage::AutoGen) { 
     2094                        if (functionDecl->linkage == ast::Linkage::AutoGen) {
    20802095                                auto mutDecl = mutate(functionDecl);
    20812096                                mutDecl->isDeleted = true;
Note: See TracChangeset for help on using the changeset viewer.