Ignore:
Timestamp:
Dec 5, 2017, 2:35:03 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
f9feab8
Parents:
9c35431 (diff), 65197c2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.impl.h

    r9c35431 rc13e8dc8  
    5555                it,
    5656                [](Declaration * decl) -> auto {
    57                         return new DeclStmt( noLabels, decl );
     57                        return new DeclStmt( decl );
    5858                }
    5959        );
     
    251251            || ( empty( beforeDecls ) && empty( afterDecls )) );
    252252
    253         CompoundStmt *compound = new CompoundStmt( noLabels );
     253        CompoundStmt *compound = new CompoundStmt();
    254254        if( !empty(beforeDecls) ) { splice( std::back_inserter( compound->get_kids() ), beforeDecls ); }
    255255        if( !empty(beforeStmts) ) { compound->get_kids().splice( compound->get_kids().end(), *beforeStmts ); }
     
    400400        {
    401401                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     402                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
     403                static ObjectDecl func(
     404                        "__func__", noStorageClasses, LinkageSpec::C, nullptr,
     405                        new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
     406                        nullptr
     407                );
     408                indexerAddId( &func );
    402409                maybeAccept_impl( node->type, *this );
    403410                maybeAccept_impl( node->statements, *this );
     
    418425        {
    419426                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     427                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
     428                static ObjectDecl func(
     429                        "__func__", noStorageClasses, LinkageSpec::C, nullptr,
     430                        new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
     431                        nullptr
     432                );
     433                indexerAddId( &func );
    420434                maybeMutate_impl( node->type, *this );
    421435                maybeMutate_impl( node->statements, *this );
     
    969983Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) {
    970984        MUTATE_BODY( Statement, node );
     985}
     986
     987
     988
     989//--------------------------------------------------------------------------
     990// NullStmt
     991template< typename pass_type >
     992void PassVisitor< pass_type >::visit( WithStmt * node ) {
     993        VISIT_START( node );
     994        maybeAccept_impl( node->exprs, *this );
     995        {
     996                // catch statements introduce a level of scope (for the caught exception)
     997                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     998                indexerAddWith( node );
     999                maybeAccept_impl( node->stmt, *this );
     1000        }
     1001        VISIT_END( node );
     1002}
     1003
     1004template< typename pass_type >
     1005Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) {
     1006        MUTATE_START( node );
     1007        maybeMutate_impl( node->exprs, *this );
     1008        {
     1009                // catch statements introduce a level of scope (for the caught exception)
     1010                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1011                indexerAddWith( node );
     1012                maybeMutate_impl( node->stmt, *this );
     1013        }
     1014        MUTATE_END( Statement, node );
    9711015}
    9721016
Note: See TracChangeset for help on using the changeset viewer.