source: src/SymTab/FixFunction.cc @ 76f2e97f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 76f2e97f was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: seventh groups of files

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[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
12// Last Modified On : Sun May 17 16:22:54 2015
13// Update Count     : 2
14//
15
[51b7345]16#include "FixFunction.h"
17#include "SynTree/Declaration.h"
18#include "SynTree/Type.h"
19#include "SynTree/Expression.h"
20#include "utility.h"
21
22namespace SymTab {
[0dd3a2f]23        FixFunction::FixFunction() : isVoid( false ) {
24        }
[51b7345]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        }
[51b7345]31
[0dd3a2f]32        Type * FixFunction::mutate(VoidType *voidType) {
33                isVoid = true;
34                return voidType;
35        }
[51b7345]36
[0dd3a2f]37        Type * FixFunction::mutate(BasicType *basicType) {
38                return basicType;
39        }
[51b7345]40
[0dd3a2f]41        Type * FixFunction::mutate(PointerType *pointerType) {
42                return pointerType;
43        }
[51b7345]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        }
[51b7345]50
[0dd3a2f]51        Type * FixFunction::mutate(StructInstType *aggregateUseType) {
52                return aggregateUseType;
53        }
[51b7345]54
[0dd3a2f]55        Type * FixFunction::mutate(UnionInstType *aggregateUseType) {
56                return aggregateUseType;
57        }
[51b7345]58
[0dd3a2f]59        Type * FixFunction::mutate(EnumInstType *aggregateUseType) {
60                return aggregateUseType;
61        }
[51b7345]62
[0dd3a2f]63        Type * FixFunction::mutate(ContextInstType *aggregateUseType) {
64                return aggregateUseType;
65        }
[51b7345]66
[0dd3a2f]67        Type * FixFunction::mutate(TypeInstType *aggregateUseType) {
68                return aggregateUseType;
69        }
[51b7345]70
[0dd3a2f]71        Type * FixFunction::mutate(TupleType *tupleType) {
72                return tupleType;
73        }
[51b7345]74} // namespace SymTab
[0dd3a2f]75
76// Local Variables: //
77// tab-width: 4 //
78// mode: c++ //
79// compile-command: "make install" //
80// End: //
Note: See TracBrowser for help on using the repository browser.