Changeset 00a8e19 for src/InitTweak
- Timestamp:
- Jan 27, 2022, 9:37:26 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 040334e, e21f253
- Parents:
- bbfe226
- Location:
- src/InitTweak
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/InitTweak/InitTweak.cc ¶
rbbfe226 r00a8e19 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 ) { -
TabularUnified src/InitTweak/InitTweak.h ¶
rbbfe226 r00a8e19 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 14:18:00 202113 // Update Count : 712 // Last Modified On : Mon Dec 6 13:20:00 2021 13 // Update Count : 8 14 14 // 15 15 … … 31 31 const FunctionDecl * isCopyConstructor( const Declaration * decl ); 32 32 const FunctionDecl * isCopyFunction( const Declaration * decl, const std::string & fname ); 33 bool isAssignment( const ast::FunctionDecl * decl ); 34 bool isDestructor( const ast::FunctionDecl * decl ); 35 bool isDefaultConstructor( const ast::FunctionDecl * decl ); 36 bool isCopyConstructor( const ast::FunctionDecl * decl ); 33 37 bool isCopyFunction( const ast::FunctionDecl * decl ); 34 38
Note: See TracChangeset
for help on using the changeset viewer.