source: translator/CodeGen/FixNames.cc @ 3848e0e

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 3848e0e was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[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
15namespace CodeGen {
16
17class FixNames : public Visitor
18{
19public:
20  virtual void visit( ObjectDecl *objectDecl );
21  virtual void visit( FunctionDecl *functionDecl );
22};
23
24void
25fixNames( std::list< Declaration* > translationUnit )
26{
27  FixNames fixer;
28  acceptAll( translationUnit, fixer );
29}
30
31void
32fixDWT( 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
41void 
42FixNames::visit( ObjectDecl *objectDecl )
43{
44  Visitor::visit( objectDecl );
45  fixDWT( objectDecl );
46}
47
48void 
49FixNames::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.