Ignore:
Timestamp:
May 18, 2015, 11:20:23 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
51587aa
Parents:
a32b204
Message:

licencing: third groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SymTab/FixFunction.cc

    ra32b204 r0dd3a2f  
     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
    116#include "FixFunction.h"
    217#include "SynTree/Declaration.h"
     
    621
    722namespace SymTab {
     23        FixFunction::FixFunction() : isVoid( false ) {
     24        }
    825
    9 FixFunction::FixFunction()
    10   : isVoid( false )
    11 {
    12 }
     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        }
    1331
    14 DeclarationWithType*
    15 FixFunction::mutate(FunctionDecl *functionDecl)
    16 {
    17   ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 );
    18   delete functionDecl;
    19   return pointer;
    20 }
     32        Type * FixFunction::mutate(VoidType *voidType) {
     33                isVoid = true;
     34                return voidType;
     35        }
    2136
    22 Type*
    23 FixFunction::mutate(VoidType *voidType)
    24 {
    25   isVoid = true;
    26   return voidType;
    27 }
     37        Type * FixFunction::mutate(BasicType *basicType) {
     38                return basicType;
     39        }
    2840
    29 Type*
    30 FixFunction::mutate(BasicType *basicType)
    31 {
    32   return basicType;
    33 }
     41        Type * FixFunction::mutate(PointerType *pointerType) {
     42                return pointerType;
     43        }
    3444
    35 Type*
    36 FixFunction::mutate(PointerType *pointerType)
    37 {
    38   return pointerType;
    39 }
     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        }
    4050
    41 Type*
    42 FixFunction::mutate(ArrayType *arrayType)
    43 {
    44   PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), maybeClone( arrayType->get_base()->clone() ), maybeClone( arrayType->get_dimension() ), arrayType->get_isVarLen(), arrayType->get_isStatic() );
    45   delete arrayType;
    46   return pointerType;
    47 }
     51        Type * FixFunction::mutate(StructInstType *aggregateUseType) {
     52                return aggregateUseType;
     53        }
    4854
    49 Type*
    50 FixFunction::mutate(StructInstType *aggregateUseType)
    51 {
    52   return aggregateUseType;
    53 }
     55        Type * FixFunction::mutate(UnionInstType *aggregateUseType) {
     56                return aggregateUseType;
     57        }
    5458
    55 Type*
    56 FixFunction::mutate(UnionInstType *aggregateUseType)
    57 {
    58   return aggregateUseType;
    59 }
     59        Type * FixFunction::mutate(EnumInstType *aggregateUseType) {
     60                return aggregateUseType;
     61        }
    6062
    61 Type*
    62 FixFunction::mutate(EnumInstType *aggregateUseType)
    63 {
    64   return aggregateUseType;
    65 }
     63        Type * FixFunction::mutate(ContextInstType *aggregateUseType) {
     64                return aggregateUseType;
     65        }
    6666
    67 Type*
    68 FixFunction::mutate(ContextInstType *aggregateUseType)
    69 {
    70   return aggregateUseType;
    71 }
     67        Type * FixFunction::mutate(TypeInstType *aggregateUseType) {
     68                return aggregateUseType;
     69        }
    7270
    73 Type*
    74 FixFunction::mutate(TypeInstType *aggregateUseType)
    75 {
    76   return aggregateUseType;
    77 }
     71        Type * FixFunction::mutate(TupleType *tupleType) {
     72                return tupleType;
     73        }
     74} // namespace SymTab
    7875
    79 Type*
    80 FixFunction::mutate(TupleType *tupleType)
    81 {
    82   return tupleType;
    83 }
    84 
    85 
    86 } // namespace SymTab
     76// Local Variables: //
     77// tab-width: 4 //
     78// mode: c++ //
     79// compile-command: "make install" //
     80// End: //
Note: See TracChangeset for help on using the changeset viewer.