source: translator/CodeGen/FixNames.cc@ 6c3744e

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 6c3744e 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
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.