| [0dd3a2f] | 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 | // FixFunction.cc -- 
 | 
|---|
 | 8 | //
 | 
|---|
 | 9 | // Author           : Richard C. Bilson
 | 
|---|
 | 10 | // Created On       : Sun May 17 16:19:49 2015
 | 
|---|
 | 11 | // Last Modified By : Peter A. Buhr
 | 
|---|
| [4040425] | 12 | // Last Modified On : Wed Mar  2 17:31:10 2016
 | 
|---|
 | 13 | // Update Count     : 3
 | 
|---|
| [0dd3a2f] | 14 | //
 | 
|---|
 | 15 | 
 | 
|---|
| [51b73452] | 16 | #include "FixFunction.h"
 | 
|---|
 | 17 | #include "SynTree/Declaration.h"
 | 
|---|
 | 18 | #include "SynTree/Type.h"
 | 
|---|
 | 19 | #include "SynTree/Expression.h"
 | 
|---|
| [d3b7937] | 20 | #include "Common/utility.h"
 | 
|---|
| [51b73452] | 21 | 
 | 
|---|
 | 22 | namespace SymTab {
 | 
|---|
| [0dd3a2f] | 23 |         FixFunction::FixFunction() : isVoid( false ) {
 | 
|---|
 | 24 |         }
 | 
|---|
| [51b73452] | 25 | 
 | 
|---|
| [0dd3a2f] | 26 |         DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) {
 | 
|---|
 | 27 |                 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 );
 | 
|---|
 | 28 |                 delete functionDecl;
 | 
|---|
 | 29 |                 return pointer;
 | 
|---|
 | 30 |         }
 | 
|---|
| [51b73452] | 31 | 
 | 
|---|
| [0dd3a2f] | 32 |         Type * FixFunction::mutate(VoidType *voidType) {
 | 
|---|
 | 33 |                 isVoid = true;
 | 
|---|
 | 34 |                 return voidType;
 | 
|---|
 | 35 |         }
 | 
|---|
| [51b73452] | 36 | 
 | 
|---|
| [0dd3a2f] | 37 |         Type * FixFunction::mutate(BasicType *basicType) {
 | 
|---|
 | 38 |                 return basicType;
 | 
|---|
 | 39 |         }
 | 
|---|
| [51b73452] | 40 | 
 | 
|---|
| [0dd3a2f] | 41 |         Type * FixFunction::mutate(PointerType *pointerType) {
 | 
|---|
 | 42 |                 return pointerType;
 | 
|---|
 | 43 |         }
 | 
|---|
| [51b73452] | 44 | 
 | 
|---|
| [0dd3a2f] | 45 |         Type * FixFunction::mutate(ArrayType *arrayType) {
 | 
|---|
 | 46 |                 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), maybeClone( arrayType->get_base()->clone() ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() );
 | 
|---|
 | 47 |                 delete arrayType;
 | 
|---|
 | 48 |                 return pointerType;
 | 
|---|
 | 49 |         }
 | 
|---|
| [51b73452] | 50 | 
 | 
|---|
| [0dd3a2f] | 51 |         Type * FixFunction::mutate(StructInstType *aggregateUseType) {
 | 
|---|
 | 52 |                 return aggregateUseType;
 | 
|---|
 | 53 |         }
 | 
|---|
| [51b73452] | 54 | 
 | 
|---|
| [0dd3a2f] | 55 |         Type * FixFunction::mutate(UnionInstType *aggregateUseType) {
 | 
|---|
 | 56 |                 return aggregateUseType;
 | 
|---|
 | 57 |         }
 | 
|---|
| [51b73452] | 58 | 
 | 
|---|
| [0dd3a2f] | 59 |         Type * FixFunction::mutate(EnumInstType *aggregateUseType) {
 | 
|---|
 | 60 |                 return aggregateUseType;
 | 
|---|
 | 61 |         }
 | 
|---|
| [51b73452] | 62 | 
 | 
|---|
| [4040425] | 63 |         Type * FixFunction::mutate(TraitInstType *aggregateUseType) {
 | 
|---|
| [0dd3a2f] | 64 |                 return aggregateUseType;
 | 
|---|
 | 65 |         }
 | 
|---|
| [51b73452] | 66 | 
 | 
|---|
| [0dd3a2f] | 67 |         Type * FixFunction::mutate(TypeInstType *aggregateUseType) {
 | 
|---|
 | 68 |                 return aggregateUseType;
 | 
|---|
 | 69 |         }
 | 
|---|
| [51b73452] | 70 | 
 | 
|---|
| [0dd3a2f] | 71 |         Type * FixFunction::mutate(TupleType *tupleType) {
 | 
|---|
 | 72 |                 return tupleType;
 | 
|---|
 | 73 |         }
 | 
|---|
| [44b7088] | 74 | 
 | 
|---|
 | 75 |         Type * FixFunction::mutate(VarArgsType *varArgsType) {
 | 
|---|
 | 76 |                 return varArgsType;
 | 
|---|
 | 77 |         }
 | 
|---|
| [51b73452] | 78 | } // namespace SymTab
 | 
|---|
| [0dd3a2f] | 79 | 
 | 
|---|
 | 80 | // Local Variables: //
 | 
|---|
 | 81 | // tab-width: 4 //
 | 
|---|
 | 82 | // mode: c++ //
 | 
|---|
 | 83 | // compile-command: "make install" //
 | 
|---|
 | 84 | // End: //
 | 
|---|