| 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 : Sat Jul 22 09:38:24 2017 | 
|---|
| 13 | // Update Count     : 4 | 
|---|
| 14 | // | 
|---|
| 15 |  | 
|---|
| 16 | #pragma once | 
|---|
| 17 |  | 
|---|
| 18 | #include "Cost.h"             // for Cost | 
|---|
| 19 | #include "SynTree/Visitor.h"  // for Visitor | 
|---|
| 20 | #include "SynTree/SynTree.h"  // for Visitor Nodes | 
|---|
| 21 |  | 
|---|
| 22 | namespace SymTab { | 
|---|
| 23 | class Indexer; | 
|---|
| 24 | }  // namespace SymTab | 
|---|
| 25 |  | 
|---|
| 26 | namespace ResolvExpr { | 
|---|
| 27 | class TypeEnvironment; | 
|---|
| 28 |  | 
|---|
| 29 | class ConversionCost : public Visitor { | 
|---|
| 30 | public: | 
|---|
| 31 | ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); | 
|---|
| 32 |  | 
|---|
| 33 | Cost get_cost() const { return cost; } | 
|---|
| 34 |  | 
|---|
| 35 | virtual void visit(VoidType *voidType); | 
|---|
| 36 | virtual void visit(BasicType *basicType); | 
|---|
| 37 | virtual void visit(PointerType *pointerType); | 
|---|
| 38 | virtual void visit(ArrayType *arrayType); | 
|---|
| 39 | virtual void visit(ReferenceType *refType); | 
|---|
| 40 | virtual void visit(FunctionType *functionType); | 
|---|
| 41 | virtual void visit(StructInstType *aggregateUseType); | 
|---|
| 42 | virtual void visit(UnionInstType *aggregateUseType); | 
|---|
| 43 | virtual void visit(EnumInstType *aggregateUseType); | 
|---|
| 44 | virtual void visit(TraitInstType *aggregateUseType); | 
|---|
| 45 | virtual void visit(TypeInstType *aggregateUseType); | 
|---|
| 46 | virtual void visit(TupleType *tupleType); | 
|---|
| 47 | virtual void visit(VarArgsType *varArgsType); | 
|---|
| 48 | virtual void visit(ZeroType *zeroType); | 
|---|
| 49 | virtual void visit(OneType *oneType); | 
|---|
| 50 | protected: | 
|---|
| 51 | Type *dest; | 
|---|
| 52 | const SymTab::Indexer &indexer; | 
|---|
| 53 | Cost cost; | 
|---|
| 54 | const TypeEnvironment &env; | 
|---|
| 55 | }; | 
|---|
| 56 |  | 
|---|
| 57 | Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); | 
|---|
| 58 | } // namespace ResolvExpr | 
|---|
| 59 |  | 
|---|
| 60 | // Local Variables: // | 
|---|
| 61 | // tab-width: 4 // | 
|---|
| 62 | // mode: c++ // | 
|---|
| 63 | // compile-command: "make install" // | 
|---|
| 64 | // End: // | 
|---|