Changeset f135b50 for src/CodeGen


Ignore:
Timestamp:
Feb 28, 2022, 3:41:44 AM (3 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/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/CodeGen/CodeGenerator.cc

    ra8ef59e rf135b50  
    274274        void CodeGenerator::postvisit( EnumDecl * enumDecl ) {
    275275                extension( enumDecl );
    276                 output << "enum ";
     276                output << "enum /* Marker CodeGenerator::EnumDecl */ ";
    277277                genAttributes( enumDecl->get_attributes() );
    278278
     
    291291                                if ( obj->get_init() ) {
    292292                                        output << " = ";
     293                                        // In progress
    293294                                        obj->get_init()->accept( *visitor );
    294295                                } // if
  • TabularUnified src/CodeGen/GenType.cc

    ra8ef59e rf135b50  
    254254        void GenType::postvisit( EnumInstType * enumInst ) {
    255255                typeString = enumInst->name + " " + typeString;
    256                 if ( options.genC ) typeString = "enum " + typeString;
     256                if ( options.genC ) typeString = "enum /* Marker GenType::EnumInstType */ " + typeString;
    257257                handleQualifiers( enumInst );
    258258        }
Note: See TracChangeset for help on using the changeset viewer.