Ignore:
Timestamp:
Sep 21, 2022, 11:02:15 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
95dab9e
Parents:
428adbc (diff), 0bd46fd (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 pthread-emulation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    r428adbc r7f6a7c9  
    509509} // build_varref
    510510
     511QualifiedNameExpr * build_qualified_expr( const DeclarationNode * decl_node, const NameExpr * name ) {
     512        Declaration * newDecl = maybeBuild< Declaration >(decl_node);
     513        if ( DeclarationWithType * newDeclWithType = dynamic_cast< DeclarationWithType * >( newDecl ) ) {
     514                const Type * t = newDeclWithType->get_type();
     515                if ( t ) {
     516                        if ( const TypeInstType * typeInst = dynamic_cast<const TypeInstType *>( t ) ) {
     517                                newDecl= new EnumDecl( typeInst->name );
     518                        }
     519                }
     520        }
     521        auto ret =  new QualifiedNameExpr( newDecl, name->name );
     522        if ( auto e = dynamic_cast<EnumDecl*>(newDecl) ) {
     523                auto enumInst = new EnumInstType( Type::Qualifiers(), e );
     524                auto obj = new ObjectDecl( name->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, enumInst, nullptr );
     525                ret->set_var( obj );
     526        }
     527        return ret;
     528}
     529
     530QualifiedNameExpr * build_qualified_expr( const EnumDecl * decl_node, const NameExpr * name ) {
     531        EnumDecl * newDecl = const_cast< EnumDecl * >( decl_node );
     532        return new QualifiedNameExpr( newDecl, name->name );
     533}
     534
    511535DimensionExpr * build_dimensionref( const string * name ) {
    512536        DimensionExpr * expr = new DimensionExpr( *name );
Note: See TracChangeset for help on using the changeset viewer.