ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
with_gc
Last change
on this file since 51fcaf8d was d3b7937, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago |
building runtime library (first attempt)
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[51587aa] | 1 | //
|
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
|
---|
| 3 | //
|
---|
| 4 | // The contents of this file are covered under the licence agreement in the
|
---|
| 5 | // file "LICENCE" distributed with Cforall.
|
---|
| 6 | //
|
---|
[a08ba92] | 7 | // InitExpander.cc --
|
---|
[51587aa] | 8 | //
|
---|
[843054c2] | 9 | // Author : Rodolfo G. Esteves
|
---|
[51587aa] | 10 | // Created On : Mon May 18 07:44:20 2015
|
---|
[a08ba92] | 11 | // Last Modified By : Peter A. Buhr
|
---|
| 12 | // Last Modified On : Tue May 19 16:34:12 2015
|
---|
| 13 | // Update Count : 1
|
---|
[51587aa] | 14 | //
|
---|
[a08ba92] | 15 |
|
---|
[51b73452] | 16 | #include <list>
|
---|
| 17 | #include <stack>
|
---|
| 18 | #include <cassert>
|
---|
| 19 | #include <algorithm>
|
---|
| 20 |
|
---|
[d3b7937] | 21 | #include "Common/utility.h"
|
---|
[51b73452] | 22 | #include "InitExpander.h"
|
---|
| 23 | #include "InitModel.h"
|
---|
| 24 |
|
---|
| 25 | namespace InitTweak {
|
---|
[a08ba92] | 26 | InitExpander::InitExpander() {}
|
---|
[51b73452] | 27 |
|
---|
[a08ba92] | 28 | InitExpander::~InitExpander() {}
|
---|
[51b73452] | 29 |
|
---|
[a08ba92] | 30 | ObjectDecl *InitExpander::mutate( ObjectDecl *objectDecl ) {
|
---|
| 31 | index.visit( objectDecl );
|
---|
[51b73452] | 32 |
|
---|
[a08ba92] | 33 | if ( objectDecl->get_init() == 0 ) return objectDecl;
|
---|
[51b73452] | 34 |
|
---|
[a08ba92] | 35 | InitModelBuilder builder( objectDecl );
|
---|
| 36 | builder.get_assoc()->display( std::cerr ); // xxx
|
---|
| 37 | InitModelFiller filler( builder.get_assoc(), objectDecl->get_init(), true );
|
---|
| 38 | // filler.get_assoc()->display( std::cerr ); // xxx
|
---|
| 39 | InitUnspooler exp;
|
---|
| 40 | filler.get_assoc()->accept( exp );
|
---|
| 41 | objectDecl->set_init( exp.grab_initializer() );
|
---|
| 42 | objectDecl->get_init()->print( std::cerr );
|
---|
[51b73452] | 43 |
|
---|
[a08ba92] | 44 | return objectDecl;
|
---|
| 45 | }
|
---|
[51b73452] | 46 | } // namespace InitTweak
|
---|
| 47 |
|
---|
[51587aa] | 48 | // Local Variables: //
|
---|
| 49 | // tab-width: 4 //
|
---|
| 50 | // mode: c++ //
|
---|
| 51 | // compile-command: "make install" //
|
---|
| 52 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.