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 | // ConversionCost.h -- |
---|
8 | // |
---|
9 | // Author : Richard C. Bilson |
---|
10 | // Created On : Sun May 17 09:37:28 2015 |
---|
11 | // Last Modified By : Peter A. Buhr |
---|
12 | // Last Modified On : Wed Mar 2 17:35:56 2016 |
---|
13 | // Update Count : 3 |
---|
14 | // |
---|
15 | |
---|
16 | #ifndef CONVERSIONCOST_H |
---|
17 | #define CONVERSIONCOST_H |
---|
18 | |
---|
19 | #include "SynTree/Visitor.h" |
---|
20 | #include "SymTab/Indexer.h" |
---|
21 | #include "Cost.h" |
---|
22 | #include "TypeEnvironment.h" |
---|
23 | |
---|
24 | namespace ResolvExpr { |
---|
25 | class ConversionCost : public Visitor { |
---|
26 | public: |
---|
27 | ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); |
---|
28 | |
---|
29 | Cost get_cost() const { return cost; } |
---|
30 | |
---|
31 | virtual void visit(VoidType *voidType); |
---|
32 | virtual void visit(BasicType *basicType); |
---|
33 | virtual void visit(PointerType *pointerType); |
---|
34 | virtual void visit(ArrayType *arrayType); |
---|
35 | virtual void visit(FunctionType *functionType); |
---|
36 | virtual void visit(StructInstType *aggregateUseType); |
---|
37 | virtual void visit(UnionInstType *aggregateUseType); |
---|
38 | virtual void visit(EnumInstType *aggregateUseType); |
---|
39 | virtual void visit(TraitInstType *aggregateUseType); |
---|
40 | virtual void visit(TypeInstType *aggregateUseType); |
---|
41 | virtual void visit(TupleType *tupleType); |
---|
42 | virtual void visit(VarArgsType *varArgsType); |
---|
43 | protected: |
---|
44 | Type *dest; |
---|
45 | const SymTab::Indexer &indexer; |
---|
46 | Cost cost; |
---|
47 | const TypeEnvironment &env; |
---|
48 | }; |
---|
49 | } // namespace ResolvExpr |
---|
50 | |
---|
51 | #endif // CONVERSIONCOST_H */ |
---|
52 | |
---|
53 | // Local Variables: // |
---|
54 | // tab-width: 4 // |
---|
55 | // mode: c++ // |
---|
56 | // compile-command: "make install" // |
---|
57 | // End: // |
---|