source: src/ResolvExpr/ConversionCost.h @ 2463d0e

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

Add conversion & cast cost for reference conversions

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[a32b204]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//
[2463d0e]7// ConversionCost.h --
[a32b204]8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 09:37:28 2015
11// Last Modified By : Peter A. Buhr
[4040425]12// Last Modified On : Wed Mar  2 17:35:56 2016
13// Update Count     : 3
[a32b204]14//
15
16#ifndef CONVERSIONCOST_H
17#define CONVERSIONCOST_H
[51b7345]18
19#include "SynTree/Visitor.h"
20#include "SymTab/Indexer.h"
21#include "Cost.h"
22#include "TypeEnvironment.h"
23
24namespace ResolvExpr {
[a32b204]25        class ConversionCost : public Visitor {
26          public:
27                ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
[2463d0e]28
[a32b204]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);
[2463d0e]35                virtual void visit(ReferenceType *refType);
[a32b204]36                virtual void visit(FunctionType *functionType);
37                virtual void visit(StructInstType *aggregateUseType);
38                virtual void visit(UnionInstType *aggregateUseType);
39                virtual void visit(EnumInstType *aggregateUseType);
[4040425]40                virtual void visit(TraitInstType *aggregateUseType);
[a32b204]41                virtual void visit(TypeInstType *aggregateUseType);
42                virtual void visit(TupleType *tupleType);
[44b7088]43                virtual void visit(VarArgsType *varArgsType);
[89e6ffc]44                virtual void visit(ZeroType *zeroType);
45                virtual void visit(OneType *oneType);
[a32b204]46          protected:
47                Type *dest;
48                const SymTab::Indexer &indexer;
49                Cost cost;
50                const TypeEnvironment &env;
51        };
[2463d0e]52
53        Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );
[51b7345]54} // namespace ResolvExpr
55
[a32b204]56#endif // CONVERSIONCOST_H */
57
58// Local Variables: //
59// tab-width: 4 //
60// mode: c++ //
61// compile-command: "make install" //
62// End: //
Note: See TracBrowser for help on using the repository browser.