Changeset 2e9b59b for src/AST/Decl.cpp


Ignore:
Timestamp:
Apr 19, 2022, 3:00:04 PM (3 years ago)
Author:
m3zulfiq <m3zulfiq@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
5b84a321
Parents:
ba897d21 (diff), bb7c77d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

added benchmark and evaluations chapter to thesis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    rba897d21 r2e9b59b  
    6868        }
    6969        for (auto & tp : this->type_params) {
    70                 ftype->forall.emplace_back(new TypeInstType(tp->name, tp));
     70                ftype->forall.emplace_back(new TypeInstType(tp));
    7171                for (auto & ap: tp->assertions) {
    7272                        ftype->assertions.emplace_back(new VariableExpr(loc, ap));
     
    136136
    137137        auto it = enumValues.find( enumerator->name );
     138       
    138139        if ( it != enumValues.end() ) {
    139                 value = it->second;
     140                       
     141                // Handle typed enum by casting the value in (C++) compiler
     142                // if ( base ) { // A typed enum
     143                //      if ( const BasicType * bt = dynamic_cast<const BasicType *>(base) ) {
     144                //              switch( bt->kind ) {
     145                //                      case BasicType::Kind::Bool:     value = (bool) it->second; break;
     146                //                      case BasicType::Kind::Char: value = (char) it->second; break;
     147                //                      case BasicType::Kind::SignedChar: value = (signed char) it->second; break;
     148                //                      case BasicType::Kind::UnsignedChar: value = (unsigned char) it->second; break;
     149                //                      case BasicType::Kind::ShortSignedInt: value = (short signed int) it->second; break;
     150                //                      case BasicType::Kind::SignedInt: value = (signed int) it->second; break;
     151                //                      case BasicType::Kind::UnsignedInt: value = (unsigned int) it->second; break;
     152                //                      case BasicType::Kind::LongSignedInt: value = (long signed int) it->second; break;
     153                //                      case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break;
     154                //                      case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break;
     155                //                      case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break;
     156                //                      // TODO: value should be able to handle long long unsigned int
     157
     158                //                      default:
     159                //                      value = it->second;
     160                //              }
     161                //      }
     162                // } else {
     163                        value = it->second;
     164                //}
     165
    140166                return true;
    141167        }
Note: See TracChangeset for help on using the changeset viewer.