Ignore:
Timestamp:
Feb 1, 2022, 10:10:46 AM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
7b2c8c3c
Parents:
f681823 (diff), 89a5a1f (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:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rf681823 r376c632a  
    1010// Created On       : Fri May 13 11:26:36 2016
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Nov 19 19:22:00 2021
    13 // Update Count     : 19
     12// Last Modified On : Mon Dec  6 13:21:00 2021
     13// Update Count     : 20
    1414//
    1515
     
    11911191        }
    11921192
    1193         bool isCopyFunction( const ast::FunctionDecl * decl ) {
    1194                 const ast::FunctionType * ftype = decl->type;
    1195                 if ( ftype->params.size() != 2 ) return false;
    1196 
    1197                 const ast::Type * t1 = getPointerBase( ftype->params.front() );
    1198                 if ( ! t1 ) return false;
    1199                 const ast::Type * t2 = ftype->params.back();
    1200 
    1201                 return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable{} );
    1202         }
     1193bool isAssignment( const ast::FunctionDecl * decl ) {
     1194        return isAssignment( decl->name ) && isCopyFunction( decl );
     1195}
     1196
     1197bool isDestructor( const ast::FunctionDecl * decl ) {
     1198        return isDestructor( decl->name );
     1199}
     1200
     1201bool isDefaultConstructor( const ast::FunctionDecl * decl ) {
     1202        return isConstructor( decl->name ) && 1 == decl->params.size();
     1203}
     1204
     1205bool isCopyConstructor( const ast::FunctionDecl * decl ) {
     1206        return isConstructor( decl->name ) && 2 == decl->params.size();
     1207}
     1208
     1209bool isCopyFunction( const ast::FunctionDecl * decl ) {
     1210        const ast::FunctionType * ftype = decl->type;
     1211        if ( ftype->params.size() != 2 ) return false;
     1212
     1213        const ast::Type * t1 = getPointerBase( ftype->params.front() );
     1214        if ( ! t1 ) return false;
     1215        const ast::Type * t2 = ftype->params.back();
     1216
     1217        return ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, ast::SymbolTable{} );
     1218}
    12031219
    12041220        const FunctionDecl * isAssignment( const Declaration * decl ) {
Note: See TracChangeset for help on using the changeset viewer.