Ignore:
Timestamp:
Feb 5, 2024, 2:17:33 AM (7 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
47bd204
Parents:
020fa10
Message:
  1. Add debug print option for replacePseudoFunc; 2. Change resolver handling enum types; 3. change QualifiedNameExpr? representation pre-resolver; 4. Disable able a test that currently doesn't work
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/FixQualifiedTypes.cpp

    r020fa10 ra55ebcc  
    8989        }
    9090
    91         ast::Expr const * postvisit( ast::QualifiedNameExpr const * t ) {
    92                 assert( location );
    93                 if ( !t->type_decl ) return t;
    94 
    95                 auto enumName = t->type_decl->name;
    96                 const ast::EnumDecl * enumDecl = symtab.lookupEnum( enumName );
    97                 for ( ast::ptr<ast::Decl> const & member : enumDecl->members ) {
    98                         if ( auto memberAsObj = member.as<ast::ObjectDecl>() ) {
    99                                 if ( memberAsObj->name == t->name ) {
    100                                         return new ast::VariableExpr( t->location, memberAsObj );
    101                                 }
    102                         } else {
    103                                 assertf( false, "unhandled qualified child type" );
    104                         }
    105                 }
    106 
    107                 auto var = new ast::ObjectDecl( t->location, t->name,
    108                         new ast::EnumInstType( enumDecl, ast::CV::Const ),
    109                         nullptr, {}, ast::Linkage::Cforall );
    110                 var->mangleName = Mangle::mangle( var );
    111                 return new ast::VariableExpr( t->location, var );
    112         }
    113 
    11491};
    11592
Note: See TracChangeset for help on using the changeset viewer.