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 5c7fb6c was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 years ago
|
initial commit
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[51b7345] | 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.