source: src/ControlStruct/Mutate.cc@ bb86117

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 string with_gc
Last change on this file since bb86117 was 4162aea9, checked in by Rob Schluntz <rschlunt@…>, 10 years ago

documentation and update control_structures.c example

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