Changeset 39f04ec for src/InitTweak
- Timestamp:
- Jul 5, 2016, 11:10:14 AM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9bb81bb8
- Parents:
- a43e1d7 (diff), d32c4e2 (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) (5 diffs)
-
FixInit.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixGlobalInit.cc
ra43e1d7 r39f04ec 9 9 // Author : Rob Schluntz 10 10 // Created On : Mon May 04 15:14:56 2016 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri May 13 11:37:30201613 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 29 22:33:15 2016 13 // Update Count : 4 14 14 // 15 15 … … 85 85 init->accept( checker ); 86 86 return checker.isConstExpr; 87 } 87 } // if 88 88 // for all intents and purposes, no initializer means const expr 89 89 return true; … … 98 98 } else { 99 99 translationUnit.push_back( fixer.initFunction ); 100 } 100 } // if 101 101 102 if ( fixer.destroyFunction->get_statements()->get_kids().empty() ) { 102 103 delete fixer.destroyFunction; 103 104 } else { 104 105 translationUnit.push_back( fixer.destroyFunction ); 105 } 106 } // if 106 107 } 107 108 … … 146 147 // if ( isConstExpr( objDecl->get_init() ) ) return; 147 148 148 if ( ArrayType * at =dynamic_cast< ArrayType * > ( objDecl->get_type() ) ) {149 if ( dynamic_cast< ArrayType * > ( objDecl->get_type() ) ) { 149 150 // xxx - initialize each element of the array 150 151 } else { … … 164 165 destroy->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) ); 165 166 destroyStatements.push_front( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, destroy ) ) ); 166 } 167 } // if 167 168 } 168 169 -
src/InitTweak/FixInit.cc
ra43e1d7 r39f04ec 449 449 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + "_dtor_atexit", DeclarationNode::NoStorageClass, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false ); 450 450 dtorCaller->fixUniqueId(); 451 dtorCaller->get_statements()->get_kids().push_back( ctorInit->get_dtor() );451 dtorCaller->get_statements()->get_kids().push_back( ctorInit->get_dtor()->clone() ); 452 452 453 453 // on_exit(dtor_atexit);
Note:
See TracChangeset
for help on using the changeset viewer.