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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    ra8ef59e rf135b50  
    7878        delete variable.initializer;
    7979
    80         delete type;
     80//      delete type;
    8181        delete bitfieldWidth;
    8282
     
    253253} // DeclarationNode::newAggregate
    254254
    255 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool ) {
     255DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed) {
    256256        DeclarationNode * newnode = new DeclarationNode;
    257257        newnode->type = new TypeData( TypeData::Enum );
     
    272272} // DeclarationNode::newName
    273273
    274 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) {
     274DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { // Marker
    275275        DeclarationNode * newnode = newName( name );
    276276        newnode->enumeratorValue.reset( constant );
     
    667667}
    668668
     669DeclarationNode * DeclarationNode::addEnumBase( DeclarationNode * o ) {
     670        if ( o && o -> type)  {
     671                type->base= o->type;
     672        }
     673        delete o;
     674        return this;
     675}
     676
    669677DeclarationNode * DeclarationNode::addTypedef() {
    670678        TypeData * newtype = new TypeData( TypeData::Symbolic );
Note: See TracChangeset for help on using the changeset viewer.