Ignore:
Timestamp:
Dec 15, 2015, 2:56:43 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, string, with_gc
Children:
4389966, ffad73a
Parents:
5e92fee
Message:

Switched size/align parameters over to use SymTab::Mangler in preparation for addition of generic types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.h

    r5e92fee r78dd0da  
    2222
    2323namespace SymTab {
     24        /// Mangles names to a unique C identifier
    2425        class Mangler : public Visitor {
    2526          public:
    2627                template< typename SynTreeClass >
    27             static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true ); // interface to clients
     28            static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool includeQualifiers = true ); // interface to clients
    2829
    29 ///   using Visitor::visit;
    3030                virtual void visit( ObjectDecl *declaration );
    3131                virtual void visit( FunctionDecl *declaration );
     
    4545                std::string get_mangleName() { return mangleName.str(); }
    4646          private:
    47                 std::ostringstream mangleName;
     47                std::ostringstream mangleName;  ///< Mangled name being constructed
    4848                typedef std::map< std::string, std::pair< int, int > > VarMapType;
    49                 VarMapType varNums;
    50                 int nextVarNum;
    51                 bool isTopLevel;
    52                 bool mangleOverridable;
     49                VarMapType varNums;             ///< Map of type variables to indices
     50                int nextVarNum;                 ///< Next type variable index
     51                bool isTopLevel;                ///< Is the Mangler at the top level
     52                bool mangleOverridable;         ///< Specially mangle overridable built-in methods
     53                bool includeQualifiers;         ///< Include type qualifiers in mangled name
    5354 
    54                 Mangler( bool mangleOverridable );
     55                Mangler( bool mangleOverridable, bool includeQualifiers );
    5556                Mangler( const Mangler & );
    5657 
     
    6263
    6364        template< typename SynTreeClass >
    64         std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable ) {
    65                 Mangler mangler( mangleOverridable );
     65        std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool includeQualifiers ) {
     66                Mangler mangler( mangleOverridable, includeQualifiers );
    6667                maybeAccept( decl, mangler );
    6768                return mangler.get_mangleName();
Note: See TracChangeset for help on using the changeset viewer.