Changeset 396ee0a for src/InitTweak
- Timestamp:
- Feb 22, 2017, 2:42:11 PM (9 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, stuck-waitfor-destruct, with_gc
- Children:
- 131dbb3, 692de479
- Parents:
- 0788b739 (diff), fc39193 (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:
-
- 4 edited
-
FixInit.cc (modified) (4 diffs)
-
GenInit.cc (modified) (2 diffs)
-
InitTweak.cc (modified) (1 diff)
-
InitTweak.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r0788b739 r396ee0a 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 12 17:41:15 201613 // Update Count : 3 412 // Last Modified On : Thu Feb 16 14:58:43 2017 13 // Update Count : 35 14 14 // 15 15 … … 313 313 translationUnit.splice( i, fixer.staticDtorDecls ); 314 314 } catch( SemanticError &e ) { 315 e.set_location( (*i)->location ); 315 316 errors.append( e ); 316 317 } // try … … 838 839 void handleFuncDecl( FunctionDecl * funcDecl, Visitor & visitor ) { 839 840 maybeAccept( funcDecl->get_functionType(), visitor ); 840 acceptAll( funcDecl->get_oldDecls(), visitor );841 841 maybeAccept( funcDecl->get_statements(), visitor ); 842 842 } … … 1116 1116 // xxx - is the size check necessary? 1117 1117 assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 ); 1118 1119 // xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary. 1118 1120 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr ); 1119 1121 addDeclaration( tmp ); -
src/InitTweak/GenInit.cc
r0788b739 r396ee0a 9 9 // Author : Rob Schluntz 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri May 13 11:37:48 201613 // Update Count : 16 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:57:53 2017 13 // Update Count : 167 14 14 // 15 15 … … 320 320 } 321 321 // parameters should not be constructed and destructed, so don't mutate FunctionType 322 mutateAll( functionDecl->get_oldDecls(), *this );323 322 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 324 323 -
src/InitTweak/InitTweak.cc
r0788b739 r396ee0a 332 332 return nullptr; 333 333 } 334 } 335 336 DeclarationWithType * getFunction( Expression * expr ) { 337 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) { 338 return getCalledFunction( appExpr->get_function() ); 339 } else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) { 340 return getCalledFunction( untyped->get_function() ); 341 } 342 assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() ); 334 343 } 335 344 -
src/InitTweak/InitTweak.h
r0788b739 r396ee0a 51 51 bool checkInitDepth( ObjectDecl * objDecl ); 52 52 53 /// Non-Null if expr is a call expression whose target function is intrinsic 54 ApplicationExpr * isIntrinsicCallExpr( Expression * expr ); 53 /// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr) 54 DeclarationWithType * getFunction( Expression * expr ); 55 56 /// Non-Null if expr is a call expression whose target function is intrinsic 57 ApplicationExpr * isIntrinsicCallExpr( Expression * expr ); 55 58 56 59 /// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
Note:
See TracChangeset
for help on using the changeset viewer.