Changeset 4a3386b4 for src/InitTweak
- Timestamp:
- Jan 19, 2017, 2:56:51 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, with_gc
- Children:
- 8f49a54
- Parents:
- 765aa76 (diff), c2416d5 (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
-
FixGlobalInit.cc (modified) (1 diff)
-
InitTweak.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixGlobalInit.cc
r765aa76 r4a3386b4 84 84 // for library code are run before constructors and destructors for user code, 85 85 // specify a priority when building the library. Priorities 0-100 are reserved by gcc. 86 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 10 1) ) );87 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 10 1) ) );86 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 87 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 88 88 } 89 89 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false ); -
src/InitTweak/InitTweak.cc
r765aa76 r4a3386b4 327 327 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 328 328 return handleDerefCalledFunction( appExpr ); 329 } else if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) { 330 return getCalledFunction( addrExpr->get_arg() ); 329 331 } 330 332 return nullptr; … … 336 338 if ( ! appExpr ) return NULL; 337 339 DeclarationWithType * function = getCalledFunction( appExpr->get_function() ); 338 assert ( function);340 assertf( function, "getCalledFunction returned nullptr: %s", toString( appExpr->get_function() ).c_str() ); 339 341 // check for Intrinsic only - don't want to remove all overridable ctor/dtors because autogenerated ctor/dtor 340 342 // will call all member dtors, and some members may have a user defined dtor. … … 386 388 } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( callExpr ) ) { 387 389 return callArg( untypedExpr, pos ); 390 } else if ( TupleAssignExpr * tupleExpr = dynamic_cast< TupleAssignExpr * > ( callExpr ) ) { 391 std::list< Statement * > & stmts = tupleExpr->get_stmtExpr()->get_statements()->get_kids(); 392 assertf( ! stmts.empty(), "TupleAssignExpr somehow has no statements." ); 393 ExprStmt * stmt = safe_dynamic_cast< ExprStmt * >( stmts.back() ); 394 TupleExpr * tuple = safe_dynamic_cast< TupleExpr * >( stmt->get_expr() ); 395 assertf( ! tuple->get_exprs().empty(), "TupleAssignExpr somehow has empty tuple expr." ); 396 return getCallArg( tuple->get_exprs().front(), pos ); 388 397 } else { 389 assertf( false, "Unexpected expression type passed to getCallArg ");398 assertf( false, "Unexpected expression type passed to getCallArg: %s", toString( callExpr ).c_str() ); 390 399 } 391 400 }
Note:
See TracChangeset
for help on using the changeset viewer.