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/SymTab/Validate.cc

    rba897d21 r2e9b59b  
    395395                                TranslateDimensionGenericParameters::translateDimensions( translationUnit );
    396396                        });
     397                        if (!useNewAST) {
    397398                        Stats::Time::TimeBlock("Resolve Enum Initializers", [&]() {
    398399                                acceptAll( translationUnit, rei ); // must happen after translateDimensions because rei needs identifier lookup, which needs name mangling
    399400                        });
     401                        }
    400402                        Stats::Time::TimeBlock("Check Function Returns", [&]() {
    401403                                ReturnChecker::checkFunctionReturns( translationUnit );
     
    405407                        });
    406408                }
     409        }
     410
     411        static void decayForallPointers( std::list< Declaration * > & translationUnit ) {
     412                PassVisitor<TraitExpander_old> te;
     413                acceptAll( translationUnit, te );
     414                PassVisitor<AssertionFixer_old> af;
     415                acceptAll( translationUnit, af );
     416                PassVisitor<CheckOperatorTypes_old> cot;
     417                acceptAll( translationUnit, cot );
     418                PassVisitor<FixUniqueIds_old> fui;
     419                acceptAll( translationUnit, fui );
    407420        }
    408421
     
    474487        }
    475488
    476         void decayForallPointers( std::list< Declaration * > & translationUnit ) {
    477                 PassVisitor<TraitExpander_old> te;
    478                 acceptAll( translationUnit, te );
    479                 PassVisitor<AssertionFixer_old> af;
    480                 acceptAll( translationUnit, af );
    481                 PassVisitor<CheckOperatorTypes_old> cot;
    482                 acceptAll( translationUnit, cot );
    483                 PassVisitor<FixUniqueIds_old> fui;
    484                 acceptAll( translationUnit, fui );
    485         }
    486 
    487         void decayForallPointersA( std::list< Declaration * > & translationUnit ) {
    488                 PassVisitor<TraitExpander_old> te;
    489                 acceptAll( translationUnit, te );
    490         }
    491         void decayForallPointersB( std::list< Declaration * > & translationUnit ) {
    492                 PassVisitor<AssertionFixer_old> af;
    493                 acceptAll( translationUnit, af );
    494         }
    495         void decayForallPointersC( std::list< Declaration * > & translationUnit ) {
    496                 PassVisitor<CheckOperatorTypes_old> cot;
    497                 acceptAll( translationUnit, cot );
    498         }
    499         void decayForallPointersD( std::list< Declaration * > & translationUnit ) {
    500                 PassVisitor<FixUniqueIds_old> fui;
    501                 acceptAll( translationUnit, fui );
    502         }
    503 
    504489        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    505490                validate_A( translationUnit );
     
    989974                                        // need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information.
    990975                                        SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init );
    991                                         ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer );
     976                                        if ( !enumDecl->base || dynamic_cast<BasicType *>(enumDecl->base))
     977                                                ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer );
     978                                        else {
     979                                                if (dynamic_cast<PointerType *>(enumDecl->base)) {
     980                                                        auto typePtr = dynamic_cast<PointerType *>(enumDecl->base);
     981                                                        ResolvExpr::findSingleExpression( init->value,
     982                                                         new PointerType( Type::Qualifiers(), typePtr->base ), indexer );
     983                                                } else {
     984                                                        ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer );
     985                                                }
     986                                        }
     987                                       
    992988                                }
    993989                        }
     990
    994991                } // if
    995992        }
     
    12551252                        declsToAddBefore.push_back( new UnionDecl( aggDecl->name, noAttributes, tyDecl->linkage ) );
    12561253                } else if ( EnumInstType * enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
    1257                         declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) );
     1254                        // declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage, enumDecl->baseEnum->base ) );
     1255                        if (enumDecl->baseEnum) {
     1256                                declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage, enumDecl->baseEnum->base ) );
     1257                        } else {
     1258                                declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) );
     1259                        }
    12581260                } // if
    12591261                return tyDecl->clone();
Note: See TracChangeset for help on using the changeset viewer.