Changeset 11a2d9b for src/InitTweak
- Timestamp:
- Oct 2, 2017, 6:02:32 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 21b7161
- Parents:
- 3096ec1 (diff), 617b4b2 (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. - Location:
- src/InitTweak
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r3096ec1 r11a2d9b 270 270 } 271 271 272 Type * getT hisType( FunctionType * ftype ) {273 assertf( ftype, "getT hisType: nullptr ftype" );274 ObjectDecl * thisParam = get ThisParam( ftype );272 Type * getTypeofThis( FunctionType * ftype ) { 273 assertf( ftype, "getTypeofThis: nullptr ftype" ); 274 ObjectDecl * thisParam = getParamThis( ftype ); 275 275 ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( thisParam->type ); 276 276 return refType->base; 277 277 } 278 278 279 ObjectDecl * get ThisParam( FunctionType * ftype ) {280 assertf( ftype, "get ThisParam: nullptr ftype" );279 ObjectDecl * getParamThis( FunctionType * ftype ) { 280 assertf( ftype, "getParamThis: nullptr ftype" ); 281 281 auto & params = ftype->parameters; 282 assertf( ! params.empty(), "get ThisParam: ftype with 0 parameters: %s", toString( ftype ).c_str() );282 assertf( ! params.empty(), "getParamThis: ftype with 0 parameters: %s", toString( ftype ).c_str() ); 283 283 return strict_dynamic_cast< ObjectDecl * >( params.front() ); 284 284 } -
src/InitTweak/InitTweak.h
r3096ec1 r11a2d9b 31 31 32 32 /// returns the base type of the first parameter to a constructor/destructor/assignment function 33 Type * getT hisType( FunctionType * ftype );33 Type * getTypeofThis( FunctionType * ftype ); 34 34 35 35 /// returns the first parameter of a constructor/destructor/assignment function 36 ObjectDecl * get ThisParam( FunctionType * ftype );36 ObjectDecl * getParamThis( FunctionType * ftype ); 37 37 38 38 /// transform Initializer into an argument list that can be passed to a call expression
Note: See TracChangeset
for help on using the changeset viewer.