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 5cb5f842 was
843054c2,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
licencing: seventh groups of files
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[51587aa] | 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 | // |
---|
[51b7345] | 15 | |
---|
| 16 | #include "FixNames.h" |
---|
| 17 | #include "SynTree/Declaration.h" |
---|
| 18 | #include "SynTree/Expression.h" |
---|
| 19 | #include "SynTree/Visitor.h" |
---|
| 20 | #include "SymTab/Mangler.h" |
---|
| 21 | #include "OperatorTable.h" |
---|
| 22 | |
---|
| 23 | namespace CodeGen { |
---|
[51587aa] | 24 | class FixNames : public Visitor { |
---|
| 25 | public: |
---|
| 26 | virtual void visit( ObjectDecl *objectDecl ); |
---|
| 27 | virtual void visit( FunctionDecl *functionDecl ); |
---|
| 28 | }; |
---|
| 29 | |
---|
| 30 | void fixNames( std::list< Declaration* > translationUnit ) { |
---|
| 31 | FixNames fixer; |
---|
| 32 | acceptAll( translationUnit, fixer ); |
---|
| 33 | } |
---|
| 34 | |
---|
| 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 | } |
---|
| 42 | |
---|
| 43 | void FixNames::visit( ObjectDecl *objectDecl ) { |
---|
| 44 | Visitor::visit( objectDecl ); |
---|
| 45 | fixDWT( objectDecl ); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | void FixNames::visit( FunctionDecl *functionDecl ) { |
---|
| 49 | Visitor::visit( functionDecl ); |
---|
| 50 | fixDWT( functionDecl ); |
---|
| 51 | } |
---|
[51b7345] | 52 | } // namespace CodeGen |
---|
[51587aa] | 53 | |
---|
| 54 | // Local Variables: // |
---|
| 55 | // tab-width: 4 // |
---|
| 56 | // mode: c++ // |
---|
| 57 | // compile-command: "make install" // |
---|
| 58 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.