Ignore:
Timestamp:
Nov 21, 2023, 4:47:58 PM (7 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
53dac82
Parents:
c36a419
Message:

Round of significant clean-up and reindentation of InitTweak? directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/GenInit.h

    rc36a419 r8984003  
    2424
    2525namespace InitTweak {
    26         /// Adds return value temporaries and wraps Initializers in ConstructorInit nodes
    27         void genInit( ast::TranslationUnit & translationUnit );
    2826
    29         /// Converts return statements into copy constructor calls on the hidden return variable.
    30         /// This pass must happen before auto-gen.
    31         void fixReturnStatements( ast::TranslationUnit & translationUnit );
     27/// Adds return value temporaries and wraps Initializers in ConstructorInit nodes
     28void genInit( ast::TranslationUnit & translationUnit );
    3229
    33         /// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument
    34         ast::ptr<ast::Stmt> genCtorDtor (const CodeLocation & loc, const std::string & fname, const ast::ObjectDecl * objDecl, const ast::Expr * arg = nullptr);
     30/// Converts return statements into copy constructor calls on the hidden return variable.
     31/// This pass must happen before auto-gen.
     32void fixReturnStatements( ast::TranslationUnit & translationUnit );
    3533
    36         /// creates an appropriate ConstructorInit node which contains a constructor, destructor, and C-initializer
    37         ast::ConstructorInit * genCtorInit( const CodeLocation & loc, const ast::ObjectDecl * objDecl );
     34/// generates a single ctor/dtor statement using objDecl as the 'this' parameter and arg as the optional argument
     35ast::ptr<ast::Stmt> genCtorDtor (const CodeLocation & loc, const std::string & fname, const ast::ObjectDecl * objDecl, const ast::Expr * arg = nullptr);
    3836
    39         class ManagedTypes final {
    40         public:
    41                 bool isManaged( const ast::ObjectDecl * objDecl ) const ; // determine if object is managed
    42                 bool isManaged( const ast::Type * type ) const; // determine if type is managed
     37/// creates an appropriate ConstructorInit node which contains a constructor, destructor, and C-initializer
     38ast::ConstructorInit * genCtorInit( const CodeLocation & loc, const ast::ObjectDecl * objDecl );
    4339
    44                 void handleDWT( const ast::DeclWithType * dwt ); // add type to managed if ctor/dtor
    45                 void handleStruct( const ast::StructDecl * aggregateDecl ); // add type to managed if child is managed
     40class ManagedTypes final {
     41public:
     42        bool isManaged( const ast::ObjectDecl * objDecl ) const ; // determine if object is managed
     43        bool isManaged( const ast::Type * type ) const; // determine if type is managed
    4644
    47                 void beginScope();
    48                 void endScope();
    49         private:
    50                 GenPoly::ScopedSet< std::string > managedTypes;
    51         };
     45        void handleDWT( const ast::DeclWithType * dwt ); // add type to managed if ctor/dtor
     46        void handleStruct( const ast::StructDecl * aggregateDecl ); // add type to managed if child is managed
     47
     48        void beginScope();
     49        void endScope();
     50private:
     51        GenPoly::ScopedSet< std::string > managedTypes;
     52};
     53
    5254} // namespace
    5355
Note: See TracChangeset for help on using the changeset viewer.