source: src/ResolvExpr/RenameVars.h @ 8a78dd3

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 8a78dd3 was c95b115, checked in by Rob Schluntz <rschlunt@…>, 7 years ago

Add reset counter to type variable renaming scheme to ensure renamings are unique across resolver calls

  • Property mode set to 100644
File size: 1.9 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>               // for list
19#include <map>                // for map
20#include <string>             // for string
21
22#include "SynTree/SynTree.h"  // for Visitor Nodes
23#include "SynTree/Visitor.h"  // for Visitor
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, resetCount;
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.