Changeset 2e3a379


Ignore:
Timestamp:
May 4, 2016, 11:07:41 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, with_gc
Children:
7cc6bd6
Parents:
d7903b1
Message:

Change cloneAndRename to clone all assertion parameters rather than only otype parameters

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rd7903b1 r2e3a379  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon May 02 14:49:01 2016
     12// Last Modified On : Tue May 03 16:44:47 2016
    1313// Update Count     : 295
    1414//
     
    12931293                        } else if ( needsAdapter( function, scopeTyVars ) ) {
    12941294                                // std::cerr << "needs adapter: ";
    1295                                 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {
    1296                                 //      std::cerr << i->first << " ";
    1297                                 // }
    1298                                 // std::cerr << "\n";
     1295                                // printTyVarMap( std::cerr, scopeTyVars );
     1296                                // std::cerr << *env << std::endl;
    12991297                                // change the application so it calls the adapter rather than the passed function
    13001298                                ret = applyAdapter( appExpr, function, arg, scopeTyVars );
  • src/SymTab/Autogen.cc

    rd7903b1 r2e3a379  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Apr 29 13:11:04 2016
     12// Last Modified On : Tue May 03 16:56:21 2016
    1313// Update Count     : 1
    1414//
     
    163163        /// Creates a new type decl that's the same as src, but renamed and with only the ?=?, ?{} (default and copy), and ^?{} assertions (for complete types only)
    164164        TypeDecl *cloneAndRename( TypeDecl *src, const std::string &name ) {
    165                 TypeDecl *dst = new TypeDecl( name, src->get_storageClass(), 0, src->get_kind() );
    166 
    167                 if ( src->get_kind() == TypeDecl::Any ) {
    168                         TypeInstType *opParamType = new TypeInstType( Type::Qualifiers(), name, dst );
    169                         FunctionType *opFunctionType = new FunctionType( Type::Qualifiers(), false );
    170                         opFunctionType->get_parameters().push_back(
    171                                 new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), opParamType->clone() ), 0 ) );
    172                         FunctionDecl *ctorAssert = new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
    173                         FunctionDecl *dtorAssert = new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
    174 
    175                         opFunctionType->get_parameters().push_back(
    176                                 new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, opParamType, 0 ) );
    177                         FunctionDecl *copyCtorAssert = new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType->clone(), 0, false, false );
    178 
    179                         opFunctionType->get_returnVals().push_back(
    180                                 new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, opParamType->clone(), 0 ) );
    181                         FunctionDecl *assignAssert = new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, opFunctionType, 0, false, false );
    182 
    183                         dst->get_assertions().push_back( assignAssert );
    184                         dst->get_assertions().push_back( ctorAssert );
    185                         dst->get_assertions().push_back( dtorAssert );
    186                         dst->get_assertions().push_back( copyCtorAssert );
    187                 }
    188 
     165                TypeDecl *dst = new TypeDecl( src->get_name(), src->get_storageClass(), 0, src->get_kind() );
     166                cloneAll(src->get_assertions(), dst->get_assertions());
    189167                return dst;
    190168        }
Note: See TracChangeset for help on using the changeset viewer.