Ignore:
Timestamp:
May 18, 2015, 11:20:23 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
51587aa
Parents:
a32b204
Message:

licencing: third groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SymTab/Mangler.h

    ra32b204 r0dd3a2f  
    1 #ifndef SYMTAB_MANGLER_H
    2 #define SYMTAB_MANGLER_H
     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// Mangler.h --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Sun May 17 21:44:03 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun May 17 21:45:05 2015
     13// Update Count     : 2
     14//
     15
     16#ifndef MANGLER_H
     17#define MANGLER_H
    318
    419#include <strstream>
     
    924    class Mangler : public Visitor {
    1025      public:
    11         template< typename SynTreeClass >
     26                template< typename SynTreeClass >
    1227            static std::string mangle( SynTreeClass *decl ); // interface to clients
    1328
    1429///   using Visitor::visit;
    15         virtual void visit( ObjectDecl *declaration );
    16         virtual void visit( FunctionDecl *declaration );
    17         virtual void visit( TypeDecl *declaration );
     30                virtual void visit( ObjectDecl *declaration );
     31                virtual void visit( FunctionDecl *declaration );
     32                virtual void visit( TypeDecl *declaration );
    1833
    19         virtual void visit( VoidType *voidType );
    20         virtual void visit( BasicType *basicType );
    21         virtual void visit( PointerType *pointerType );
    22         virtual void visit( ArrayType *arrayType );
    23         virtual void visit( FunctionType *functionType );
    24         virtual void visit( StructInstType *aggregateUseType );
    25         virtual void visit( UnionInstType *aggregateUseType );
    26         virtual void visit( EnumInstType *aggregateUseType );
    27         virtual void visit( TypeInstType *aggregateUseType );
    28         virtual void visit( TupleType *tupleType );
     34                virtual void visit( VoidType *voidType );
     35                virtual void visit( BasicType *basicType );
     36                virtual void visit( PointerType *pointerType );
     37                virtual void visit( ArrayType *arrayType );
     38                virtual void visit( FunctionType *functionType );
     39                virtual void visit( StructInstType *aggregateUseType );
     40                virtual void visit( UnionInstType *aggregateUseType );
     41                virtual void visit( EnumInstType *aggregateUseType );
     42                virtual void visit( TypeInstType *aggregateUseType );
     43                virtual void visit( TupleType *tupleType );
    2944 
    30         std::string get_mangleName() { return std::string( mangleName.str(), mangleName.pcount() ); }
     45                std::string get_mangleName() { return std::string( mangleName.str(), mangleName.pcount() ); }
    3146      private:
    32         std::ostrstream mangleName;
    33         typedef std::map< std::string, std::pair< int, int > > VarMapType;
    34         VarMapType varNums;
    35         int nextVarNum;
    36         bool isTopLevel;
     47                std::ostrstream mangleName;
     48                typedef std::map< std::string, std::pair< int, int > > VarMapType;
     49                VarMapType varNums;
     50                int nextVarNum;
     51                bool isTopLevel;
    3752 
    38         Mangler();
    39         Mangler( const Mangler & );
     53                Mangler();
     54                Mangler( const Mangler & );
    4055 
    41         void mangleDecl( DeclarationWithType *declaration );
    42         void mangleRef( ReferenceToType *refType, std::string prefix );
     56                void mangleDecl( DeclarationWithType *declaration );
     57                void mangleRef( ReferenceToType *refType, std::string prefix );
    4358 
    44         void printQualifiers( Type *type );
     59                void printQualifiers( Type *type );
    4560    }; // Mangler
    4661
    4762    template< typename SynTreeClass >
    4863    std::string Mangler::mangle( SynTreeClass *decl ) {
    49         Mangler mangler;
    50         maybeAccept( decl, mangler );
    51         return mangler.get_mangleName();
     64                Mangler mangler;
     65                maybeAccept( decl, mangler );
     66                return mangler.get_mangleName();
    5267    }
    5368} // SymTab
    5469
    55 #endif // SYMTAB_MANGLER_H
     70#endif // MANGLER_H
     71
     72// Local Variables: //
     73// tab-width: 4 //
     74// mode: c++ //
     75// compile-command: "make install" //
     76// End: //
Note: See TracChangeset for help on using the changeset viewer.