Ignore:
Timestamp:
Jan 31, 2024, 6:25:02 PM (5 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
32490deb
Parents:
16afb2a
Message:

Introduce posE, valueE, labelE pseudo language to the language. Rework the internal representation of enumeration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cpp

    r16afb2a rc75b30a  
    133133                        return func->linkage == ast::Linkage::Intrinsic
    134134                                && lvalueFunctions.count( func->name );
     135                }
     136        }
     137        return false;
     138}
     139
     140bool isGeneratedInstrinct( ast::Expr const * expr ) {
     141        if ( auto app = dynamic_cast<ast::ApplicationExpr const *>( expr ) ) {
     142                if ( app->args.size() == 2 && ast::getFunction( app )->name == "?[?]" ) {
     143                        auto param_1 = dynamic_cast<ast::VariableExpr const *>(app->args.front().get());
     144                        if ( param_1 ) {
     145                                auto param_1_as_obj = param_1->var.as<ast::ObjectDecl>();
     146                                return ( param_1_as_obj->name.find( "values_") != std::string::npos
     147                                        ||  param_1_as_obj->name.find( "labels_" ) != std::string::npos );
     148                        }
    135149                }
    136150        }
     
    161175ast::Expr const * FixIntrinsicResults::postvisit(
    162176                ast::ApplicationExpr const * expr ) {
    163         if ( skip == SkipInProgress || !isIntrinsicReference( expr ) ) {
     177
     178        if ( skip == SkipInProgress || !isIntrinsicReference( expr ) || isGeneratedInstrinct( expr ) ) {
    164179                return expr;
    165180        }
Note: See TracChangeset for help on using the changeset viewer.