ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change
on this file since 8c17ab0 was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
initial commit
|
-
Property mode set to
100644
|
File size:
845 bytes
|
Rev | Line | |
---|
[51b7345] | 1 | #include <list> |
---|
| 2 | #include <stack> |
---|
| 3 | #include <cassert> |
---|
| 4 | #include <algorithm> |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | #include "utility.h" |
---|
| 8 | #include "InitExpander.h" |
---|
| 9 | #include "InitModel.h" |
---|
| 10 | |
---|
| 11 | namespace InitTweak { |
---|
| 12 | |
---|
| 13 | InitExpander::InitExpander() {} |
---|
| 14 | |
---|
| 15 | InitExpander::~InitExpander() {} |
---|
| 16 | |
---|
| 17 | ObjectDecl *InitExpander::mutate( ObjectDecl *objectDecl ) { |
---|
| 18 | index.visit( objectDecl ); |
---|
| 19 | |
---|
| 20 | if( objectDecl->get_init() == 0 ) return objectDecl; |
---|
| 21 | |
---|
| 22 | InitModelBuilder builder( objectDecl ); |
---|
| 23 | builder.get_assoc()->display( std::cerr ); // xxx |
---|
| 24 | InitModelFiller filler( builder.get_assoc(), objectDecl->get_init(), true ); |
---|
| 25 | // filler.get_assoc()->display( std::cerr ); // xxx |
---|
| 26 | InitUnspooler exp; |
---|
| 27 | filler.get_assoc()->accept( exp ); |
---|
| 28 | objectDecl->set_init( exp.grab_initializer() ); |
---|
| 29 | objectDecl->get_init()->print( std::cerr ); |
---|
| 30 | |
---|
| 31 | return objectDecl; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | } // namespace InitTweak |
---|
| 35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.