Changeset c36814a


Ignore:
Timestamp:
Sep 14, 2022, 11:53:40 AM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
ce31925
Parents:
1c0657a
Message:

Adding 'final' and removing a redundent namespace in the post resolve new ast code.

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/WaitforNew.cpp

    r1c0657a rc36814a  
    101101namespace {
    102102
    103 class GenerateWaitForCore :
     103class GenerateWaitForCore final :
    104104                public ast::WithSymbolTable, public ast::WithConstTranslationUnit {
    105105        const ast::FunctionDecl * decl_waitfor    = nullptr;
  • src/ControlStruct/ExceptTranslateNew.cpp

    r1c0657a rc36814a  
    3232        }
    3333
    34 class TranslateThrowsCore : public ast::WithGuards {
     34class TranslateThrowsCore final : public ast::WithGuards {
    3535        const ast::ObjectDecl * terminateHandlerExcept;
    3636        enum Context { NoHandler, TerHandler, ResHandler } currentContext;
     
    136136
    137137
    138 class TryMutatorCore {
     138class TryMutatorCore final {
    139139        // The built in types used in translation.
    140140        const ast::StructDecl * except_decl;
  • src/GenPoly/InstantiateGenericNew.cpp

    r1c0657a rc36814a  
    8585
    8686/// Maps a key and a TypeList to a valuue. Also supports scoping.
    87 class InstantiationMap {
     87class InstantiationMap final {
    8888        /// Wraps value for a specific (AggregateDecl, TypeList) combination.
    8989        using Instantiation = std::pair<TypeList, ast::ptr<ast::AggregateDecl>>;
  • src/GenPoly/SpecializeNew.cpp

    r1c0657a rc36814a  
    240240}
    241241
    242 namespace {
    243         struct TypeInstFixer : public ast::WithShortCircuiting {
    244                 std::map<const ast::TypeDecl *, std::pair<int, int>> typeMap;
    245 
    246                 void previsit(const ast::TypeDecl *) { visit_children = false; }
    247                 const ast::TypeInstType * postvisit(const ast::TypeInstType * typeInst) {
    248                         if (typeMap.count(typeInst->base)) {
    249                                 ast::TypeInstType * newInst = mutate(typeInst);
    250                                 auto const & pair = typeMap[typeInst->base];
    251                                 newInst->expr_id = pair.first;
    252                                 newInst->formal_usage = pair.second;
    253                                 return newInst;
    254                         }
    255                         return typeInst;
    256                 }
    257         };
    258 }
     242struct TypeInstFixer final : public ast::WithShortCircuiting {
     243        std::map<const ast::TypeDecl *, std::pair<int, int>> typeMap;
     244
     245        void previsit(const ast::TypeDecl *) { visit_children = false; }
     246        const ast::TypeInstType * postvisit(const ast::TypeInstType * typeInst) {
     247                if (typeMap.count(typeInst->base)) {
     248                        ast::TypeInstType * newInst = mutate(typeInst);
     249                        auto const & pair = typeMap[typeInst->base];
     250                        newInst->expr_id = pair.first;
     251                        newInst->formal_usage = pair.second;
     252                        return newInst;
     253                }
     254                return typeInst;
     255        }
     256};
    259257
    260258const ast::Expr * SpecializeCore::createThunkFunction(
  • src/Tuples/TupleExpansionNew.cpp

    r1c0657a rc36814a  
    101101
    102102/// Replaces Tuple Assign & Index Expressions, and Tuple Types.
    103 struct TupleMainExpander :
     103struct TupleMainExpander final :
    104104                public ast::WithGuards,
    105105                public ast::WithVisitorRef<TupleMainExpander>,
     
    254254}
    255255
    256 struct TupleExprExpander {
     256struct TupleExprExpander final {
    257257        ast::Expr const * postvisit( ast::TupleExpr const * expr ) {
    258258                return replaceTupleExpr( expr->location,
  • src/Virtual/ExpandCasts.cc

    r1c0657a rc36814a  
    317317};
    318318
    319 struct ExpandCastsCore {
     319struct ExpandCastsCore final {
    320320        void previsit( ast::FunctionDecl const * decl );
    321321        void previsit( ast::StructDecl const * decl );
Note: See TracChangeset for help on using the changeset viewer.