source: src/ResolvExpr/RenameVars.h @ a5f0529

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since a5f0529 was 6b0b624, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

change #ifndef to #pragma once

  • Property mode set to 100644
File size: 1.7 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// RenameVars.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 12:10:28 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sat Jul 22 09:33:54 2017
13// Update Count     : 4
14//
15
16#pragma once
17
18#include <list>
19#include <map>
20#include <string>
21
22#include "SynTree/SynTree.h"
23#include "SynTree/Visitor.h"
24
25namespace ResolvExpr {
26
27        /// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID
28        class RenameVars : public Visitor {
29          public:
30                RenameVars();
31                void reset();
32          private:
33                virtual void visit( VoidType *basicType );
34                virtual void visit( BasicType *basicType );
35                virtual void visit( PointerType *pointerType );
36                virtual void visit( ArrayType *arrayType );
37                virtual void visit( FunctionType *functionType );
38                virtual void visit( StructInstType *aggregateUseType );
39                virtual void visit( UnionInstType *aggregateUseType );
40                virtual void visit( EnumInstType *aggregateUseType );
41                virtual void visit( TraitInstType *aggregateUseType );
42                virtual void visit( TypeInstType *aggregateUseType );
43                virtual void visit( TupleType *tupleType );
44                virtual void visit( VarArgsType *varArgsType );
45                virtual void visit( ZeroType *zeroType );
46                virtual void visit( OneType *oneType );
47
48                void typeBefore( Type *type );
49                void typeAfter( Type *type );
50                int level;
51                std::list< std::map< std::string, std::string > > mapStack;
52        };
53
54        extern RenameVars global_renamer;
55} // namespace ResolvExpr
56
57// Local Variables: //
58// tab-width: 4 //
59// mode: c++ //
60// compile-command: "make install" //
61// End: //
Note: See TracBrowser for help on using the repository browser.