Changeset 4429b04


Ignore:
Timestamp:
Nov 30, 2017, 10:52:13 AM (6 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:
61255ad, ba3706f
Parents:
efe8172b
Message:

Implicitly add C func identifier to Indexer in function scope

File:
1 edited

Legend:

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

    refe8172b r4429b04  
    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 );
Note: See TracChangeset for help on using the changeset viewer.