Ignore:
Timestamp:
Aug 25, 2016, 9:14:18 PM (8 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, 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:
a839867
Parents:
c1c1112 (diff), 486341f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/GenType.cc

    rc1c1112 r4e2b9710  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenType.cc -- 
     7// GenType.cc --
    88//
    99// Author           : Richard C. Bilson
     
    2828        class GenType : public Visitor {
    2929          public:
    30                 GenType( const std::string &typeString );
     30                GenType( const std::string &typeString, bool mangle = true );
    3131                std::string get_typeString() const { return typeString; }
    3232                void set_typeString( const std::string &newValue ) { typeString = newValue; }
    33  
     33
    3434                virtual void visit( FunctionType *funcType );
    3535                virtual void visit( VoidType *voidType );
     
    4242                virtual void visit( TypeInstType *typeInst );
    4343                virtual void visit( VarArgsType *varArgsType );
    44  
     44
    4545          private:
    4646                void handleQualifiers( Type *type );
    4747                void genArray( const Type::Qualifiers &qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic );
    48  
     48
    4949                std::string typeString;
     50                bool mangle = true;
    5051        };
    5152
    52         std::string genType( Type *type, const std::string &baseString ) {
    53                 GenType gt( baseString );
     53        std::string genType( Type *type, const std::string &baseString, bool mangle ) {
     54                GenType gt( baseString, mangle );
    5455                type->accept( gt );
    5556                return gt.get_typeString();
    5657        }
    5758
    58         GenType::GenType( const std::string &typeString ) : typeString( typeString ) {}
     59        GenType::GenType( const std::string &typeString, bool mangle ) : typeString( typeString ), mangle( mangle ) {}
    5960
    6061        void GenType::visit( VoidType *voidType ) {
     
    100101                } // if
    101102                if ( dimension != 0 ) {
    102                         CodeGenerator cg( os );
     103                        CodeGenerator cg( os, mangle );
    103104                        dimension->accept( cg );
    104105                } else if ( isVarLen ) {
     
    109110
    110111                typeString = os.str();
    111  
     112
    112113                base->accept( *this );
    113114        }
     
    142143                        } // if
    143144                } // if
    144  
     145
    145146                /************* parameters ***************/
    146147
     
    154155                        } // if
    155156                } else {
    156                         CodeGenerator cg( os );
     157                        CodeGenerator cg( os, mangle );
    157158                        os << "(" ;
    158159
     
    164165                        os << ")";
    165166                } // if
    166  
     167
    167168                typeString = os.str();
    168169
Note: See TracChangeset for help on using the changeset viewer.