Changeset 25bd9074


Ignore:
Timestamp:
Jul 27, 2017, 11:05:51 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
00e80b6
Parents:
2afec66
git-author:
Rob Schluntz <rschlunt@…> (07/26/17 17:24:59)
git-committer:
Rob Schluntz <rschlunt@…> (07/27/17 11:05:51)
Message:

Add name mangling for reference types

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    r2afec66 r25bd9074  
    131131                mangleName << "A0";
    132132                maybeAccept( arrayType->get_base(), *this );
     133        }
     134
     135        void Mangler::visit( ReferenceType *refType ) {
     136                printQualifiers( refType );
     137                mangleName << "R";
     138                maybeAccept( refType->get_base(), *this );
    133139        }
    134140
     
    302308                // Removed due to restrict not affecting function compatibility in GCC
    303309//              if ( type->get_isRestrict() ) {
    304 //                      mangleName << "R";
     310//                      mangleName << "E";
    305311//              } // if
    306312                if ( type->get_lvalue() ) {
  • src/SymTab/Mangler.h

    r2afec66 r25bd9074  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Mangler.h -- 
     7// Mangler.h --
    88//
    99// Author           : Richard C. Bilson
     
    3939                virtual void visit( PointerType *pointerType );
    4040                virtual void visit( ArrayType *arrayType );
     41                virtual void visit( ReferenceType *refType );
    4142                virtual void visit( FunctionType *functionType );
    4243                virtual void visit( StructInstType *aggregateUseType );
     
    4849                virtual void visit( ZeroType *zeroType );
    4950                virtual void visit( OneType *oneType );
    50  
     51
    5152                std::string get_mangleName() { return mangleName.str(); }
    5253          private:
     
    5859                bool mangleOverridable;         ///< Specially mangle overridable built-in methods
    5960                bool typeMode;                  ///< Produce a unique mangled name for a type
    60  
     61
    6162                Mangler( bool mangleOverridable, bool typeMode );
    6263                Mangler( const Mangler & );
    63  
     64
    6465                void mangleDecl( DeclarationWithType *declaration );
    6566                void mangleRef( ReferenceToType *refType, std::string prefix );
    6667                void mangleGenericRef( ReferenceToType *refType, std::string prefix );
    67  
     68
    6869                void printQualifiers( Type *type );
    6970        }; // Mangler
Note: See TracChangeset for help on using the changeset viewer.