Changeset 3cc1111 for src/InitTweak


Ignore:
Timestamp:
Nov 24, 2021, 3:16:15 PM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
0351e9f, 7770cc8
Parents:
2514f68b
Message:

Small fix in Decl.hpp and a new-ast function added in InitTweak?.

Location:
src/InitTweak
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    r2514f68b r3cc1111  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri May 13 11:26:36 2016
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 16 20:57:22 2021
    13 // Update Count     : 18
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Nov 19 19:22:00 2021
     13// Update Count     : 19
    1414//
    1515
     
    540540        }
    541541
     542        const ast::Type * getTypeofThis( const ast::FunctionType * ftype ) {
     543                assertf( ftype, "getTypeofThis: nullptr ftype" );
     544                const std::vector<ast::ptr<ast::Type>> & params = ftype->params;
     545                assertf( !params.empty(), "getTypeofThis: ftype with 0 parameters: %s",
     546                                toString( ftype ).c_str() );
     547                const ast::ReferenceType * refType =
     548                        params.front().strict_as<ast::ReferenceType>();
     549                return refType->base;
     550        }
     551
    542552        ObjectDecl * getParamThis( FunctionType * ftype ) {
    543553                assertf( ftype, "getParamThis: nullptr ftype" );
  • src/InitTweak/InitTweak.h

    r2514f68b r3cc1111  
    1010// Created On       : Fri May 13 11:26:36 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 19 14:18:00 2019
    13 // Update Count     : 6
     12// Last Modified On : Fri Nov 19 14:18:00 2021
     13// Update Count     : 7
    1414//
    1515
     
    3535        /// returns the base type of the first parameter to a constructor/destructor/assignment function
    3636        Type * getTypeofThis( FunctionType * ftype );
     37        const ast::Type * getTypeofThis( const ast::FunctionType * ftype );
    3738
    3839        /// returns the first parameter of a constructor/destructor/assignment function
Note: See TracChangeset for help on using the changeset viewer.