source: src/ControlStruct/Mutate.cc@ 5f20b30

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox 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 5f20b30 was 1fbeebd, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

Convert LabelFixer to PassVisitor

  • Property mode set to 100644
File size: 1.5 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//
[982d63f]7// Mutate.cc --
[51587aa]8//
[843054c2]9// Author : Rodolfo G. Esteves
[51587aa]10// Created On : Mon May 18 07:44:20 2015
[4e06c1e]11// Last Modified By : Peter A. Buhr
[8688ce1]12// Last Modified On : Thu Aug 4 11:39:08 2016
13// Update Count : 9
[51587aa]14//
[a08ba92]15
[d180746]16#include <iterator> // for back_inserter, inserter
17#include <list> // for list
[51b73452]18
[be9288a]19#include "Common/PassVisitor.h" // for mutateAll
[d180746]20#include "Common/SemanticError.h" // for SemanticError
21#include "ForExprMutator.h" // for ForExprMutator
22#include "LabelFixer.h" // for LabelFixer
[51b73452]23#include "Mutate.h"
[d180746]24#include "SynTree/Declaration.h" // for Declaration
25#include "SynTree/Mutator.h" // for mutateAll
[51b73452]26
[d180746]27#include "Common/PassVisitor.h" // for PassVisitor
28#include "SynTree/Visitor.h" // for acceptAll
[51b73452]29
30using namespace std;
31
32namespace ControlStruct {
[a08ba92]33 void mutate( std::list< Declaration * > translationUnit ) {
[145f1fc]34 // hoist initialization out of for statements
[0db6fc0]35 PassVisitor<ForExprMutator> formut;
[4162aea9]36
[4e06c1e]37 // normalizes label definitions and generates multi-level exit labels
[1fbeebd]38 PassVisitor<LabelFixer> lfix;
[a08ba92]39
[145f1fc]40 mutateAll( translationUnit, formut );
[982d63f]41 acceptAll( translationUnit, lfix );
[a08ba92]42 }
[51b73452]43} // namespace CodeGen
[a08ba92]44
[51587aa]45// Local Variables: //
46// tab-width: 4 //
47// mode: c++ //
48// compile-command: "make install" //
49// End: //
Note: See TracBrowser for help on using the repository browser.