Ignore:
Timestamp:
May 18, 2015, 11:45:33 PM (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:
01aeade
Parents:
0dd3a2f
Message:

licencing: fourth groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/CodeGen/FixNames.cc

    r0dd3a2f r51587aa  
    1 /*
    2  * This file is part of the Cforall project
    3  *
    4  * $Id: FixNames.cc,v 1.8 2005/08/29 20:14:12 rcbilson Exp $
    5  *
    6  */
     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// FixNames.cc --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Mon May 18 07:44:20 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon May 18 23:36:42 2015
     13// Update Count     : 1
     14//
    715
    816#include "FixNames.h"
     
    1422
    1523namespace CodeGen {
     24        class FixNames : public Visitor {
     25          public:
     26                virtual void visit( ObjectDecl *objectDecl );
     27                virtual void visit( FunctionDecl *functionDecl );
     28        };
    1629
    17 class FixNames : public Visitor
    18 {
    19 public:
    20   virtual void visit( ObjectDecl *objectDecl );
    21   virtual void visit( FunctionDecl *functionDecl );
    22 };
     30        void fixNames( std::list< Declaration* > translationUnit ) {
     31                FixNames fixer;
     32                acceptAll( translationUnit, fixer );
     33        }
    2334
    24 void
    25 fixNames( std::list< Declaration* > translationUnit )
    26 {
    27   FixNames fixer;
    28   acceptAll( translationUnit, fixer );
    29 }
     35        void fixDWT( DeclarationWithType *dwt ) {
     36                if ( dwt->get_name() != "" ) {
     37                        if ( LinkageSpec::isDecoratable( dwt->get_linkage() ) ) {
     38                                dwt->set_mangleName( SymTab::Mangler::mangle( dwt ) );
     39                        } // if
     40                } // if
     41        }
    3042
    31 void
    32 fixDWT( DeclarationWithType *dwt )
    33 {
    34   if ( dwt->get_name() != "" ) {
    35     if ( LinkageSpec::isDecoratable( dwt->get_linkage() ) ) {
    36       dwt->set_mangleName( SymTab::Mangler::mangle( dwt ) );
    37     }
    38   }
    39 }
     43        void FixNames::visit( ObjectDecl *objectDecl ) {
     44                Visitor::visit( objectDecl );
     45                fixDWT( objectDecl );
     46        }
    4047
    41 void
    42 FixNames::visit( ObjectDecl *objectDecl )
    43 {
    44   Visitor::visit( objectDecl );
    45   fixDWT( objectDecl );
    46 }
     48        void FixNames::visit( FunctionDecl *functionDecl ) {
     49                Visitor::visit( functionDecl );
     50                fixDWT( functionDecl );
     51        }
     52} // namespace CodeGen
    4753
    48 void
    49 FixNames::visit( FunctionDecl *functionDecl )
    50 {
    51   Visitor::visit( functionDecl );
    52   fixDWT( functionDecl );
    53 }
    54 
    55 } // namespace CodeGen
     54// Local Variables: //
     55// tab-width: 4 //
     56// mode: c++ //
     57// compile-command: "make install" //
     58// End: //
Note: See TracChangeset for help on using the changeset viewer.