ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        ctor
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        gc_noraii
        jacob/cs343-translation
        jenkins-sandbox
        memory
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        string
        with_gc
      
      
        
          | Last change
 on this file since 643a2e1 was             51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago | 
        
          | 
initial commit
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.0 KB | 
      
      
| Line |  | 
|---|
| 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 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #include "FixNames.h" | 
|---|
| 9 | #include "SynTree/Declaration.h" | 
|---|
| 10 | #include "SynTree/Expression.h" | 
|---|
| 11 | #include "SynTree/Visitor.h" | 
|---|
| 12 | #include "SymTab/Mangler.h" | 
|---|
| 13 | #include "OperatorTable.h" | 
|---|
| 14 |  | 
|---|
| 15 | namespace CodeGen { | 
|---|
| 16 |  | 
|---|
| 17 | class FixNames : public Visitor | 
|---|
| 18 | { | 
|---|
| 19 | public: | 
|---|
| 20 | virtual void visit( ObjectDecl *objectDecl ); | 
|---|
| 21 | virtual void visit( FunctionDecl *functionDecl ); | 
|---|
| 22 | }; | 
|---|
| 23 |  | 
|---|
| 24 | void | 
|---|
| 25 | fixNames( std::list< Declaration* > translationUnit ) | 
|---|
| 26 | { | 
|---|
| 27 | FixNames fixer; | 
|---|
| 28 | acceptAll( translationUnit, fixer ); | 
|---|
| 29 | } | 
|---|
| 30 |  | 
|---|
| 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 | } | 
|---|
| 40 |  | 
|---|
| 41 | void | 
|---|
| 42 | FixNames::visit( ObjectDecl *objectDecl ) | 
|---|
| 43 | { | 
|---|
| 44 | Visitor::visit( objectDecl ); | 
|---|
| 45 | fixDWT( objectDecl ); | 
|---|
| 46 | } | 
|---|
| 47 |  | 
|---|
| 48 | void | 
|---|
| 49 | FixNames::visit( FunctionDecl *functionDecl ) | 
|---|
| 50 | { | 
|---|
| 51 | Visitor::visit( functionDecl ); | 
|---|
| 52 | fixDWT( functionDecl ); | 
|---|
| 53 | } | 
|---|
| 54 |  | 
|---|
| 55 | } // namespace CodeGen | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.