Changeset 376c632a for src/InitTweak/InitTweak.cc
- Timestamp:
- Feb 1, 2022, 10:10:46 AM (2 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
rf681823 r376c632a 10 10 // Created On : Fri May 13 11:26:36 2016 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Nov 19 19:22:00 202113 // Update Count : 1912 // Last Modified On : Mon Dec 6 13:21:00 2021 13 // Update Count : 20 14 14 // 15 15 … … 1191 1191 } 1192 1192 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 } 1193 bool isAssignment( const ast::FunctionDecl * decl ) { 1194 return isAssignment( decl->name ) && isCopyFunction( decl ); 1195 } 1196 1197 bool isDestructor( const ast::FunctionDecl * decl ) { 1198 return isDestructor( decl->name ); 1199 } 1200 1201 bool isDefaultConstructor( const ast::FunctionDecl * decl ) { 1202 return isConstructor( decl->name ) && 1 == decl->params.size(); 1203 } 1204 1205 bool isCopyConstructor( const ast::FunctionDecl * decl ) { 1206 return isConstructor( decl->name ) && 2 == decl->params.size(); 1207 } 1208 1209 bool 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 } 1203 1219 1204 1220 const FunctionDecl * isAssignment( const Declaration * decl ) {
Note: See TracChangeset
for help on using the changeset viewer.