source: src/ControlStruct/Mutate.cc @ b617e4b

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since b617e4b was d3b7937, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

building runtime library (first attempt)

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[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// Mutate.cc --
[51587aa]8//
[843054c2]9// Author           : Rodolfo G. Esteves
[51587aa]10// Created On       : Mon May 18 07:44:20 2015
[4162aea9]11// Last Modified By : Rob Schluntz
[145f1fc]12// Last Modified On : Wed Jul 15 14:50:04 2015
13// Update Count     : 7
[51587aa]14//
[a08ba92]15
[51b7345]16#include <algorithm>
17#include <iostream>
18#include <cassert>
19#include <list>
20
21#include "Mutate.h"
22#include "ChooseMutator.h"
23#include "LabelFixer.h"
24#include "MLEMutator.h"
25#include "CaseRangeMutator.h"
26#include "ForExprMutator.h"
27#include "LabelTypeChecker.h"
28//#include "ExceptMutator.h"
29
[d3b7937]30#include "Common/utility.h"
[51b7345]31
32#include "SynTree/Visitor.h"
33
34using namespace std;
35
36namespace ControlStruct {
[a08ba92]37        void mutate( std::list< Declaration * > translationUnit ) {
[145f1fc]38                // hoist initialization out of for statements
39                ForExprMutator formut;
[4162aea9]40
41                // normalizes label definitions and generates multi-level
42                // exit labels
[a08ba92]43                LabelFixer lfix;
[4162aea9]44
45                // transform choose statements into switch statements
[a08ba92]46                ChooseMutator chmut;
[4162aea9]47
48                // expand case ranges and turn fallthru into a null statement
[a08ba92]49                CaseRangeMutator ranges;  // has to run after ChooseMutator
[4162aea9]50
[a08ba92]51                //ExceptMutator exc;
52                // LabelTypeChecker lbl;
53
[145f1fc]54                mutateAll( translationUnit, formut );
[a08ba92]55                acceptAll( translationUnit, lfix );
56                mutateAll( translationUnit, chmut );
57                mutateAll( translationUnit, ranges );
58                //mutateAll( translationUnit, exc );
59                //acceptAll( translationUnit, lbl );
60        }
[51b7345]61} // namespace CodeGen
[a08ba92]62
[51587aa]63// Local Variables: //
64// tab-width: 4 //
65// mode: c++ //
66// compile-command: "make install" //
67// End: //
Note: See TracBrowser for help on using the repository browser.