Changeset f135b50 for src/Common


Ignore:
Timestamp:
Feb 28, 2022, 3:41:44 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
786c438
Parents:
a8ef59e
Message:

The compiler is now trying to pass the value of enum const to code gen; but it won't work cause we must be able to evaluate the const_expr in compiler time. It is not currently passed as a Expression but won't be able to evaluate at compile time

Location:
src/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/Eval.cc

    ra8ef59e rf135b50  
    112112        }
    113113
    114         void postvisit( const ast::VariableExpr * expr ) {
     114        void postvisit( const ast::VariableExpr * expr ) { // No hit
    115115                if ( const ast::EnumInstType * inst = dynamic_cast<const ast::EnumInstType *>(expr->result.get()) ) {
    116116                        if ( const ast::EnumDecl * decl = inst->base ) {
  • src/Common/PassVisitor.impl.h

    ra8ef59e rf135b50  
    754754
    755755        // unlike structs, traits, and unions, enums inject their members into the global scope
     756        if ( node->base ) maybeAccept_impl( node->base, *this ); // Need this? Maybe not?
    756757        maybeAccept_impl( node->parameters, *this );
    757758        maybeAccept_impl( node->members   , *this );
Note: See TracChangeset for help on using the changeset viewer.