Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8d7bef2
Parents:
6171841
git-author:
Aaron Moss <a3moss@…> (03/16/18 17:04:24)
git-committer:
Aaron Moss <a3moss@…> (03/16/18 17:15:02)
Message:

First pass at delete removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AdjustExprType.cc

    r6171841 r68f9c43  
    6666
    6767        Type * AdjustExprType::postmutate( ArrayType * arrayType ) {
    68                 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base );
    69                 arrayType->base = nullptr;
    70                 delete arrayType;
    71                 return pointerType;
     68                return new PointerType{ arrayType->get_qualifiers(), arrayType->base };
    7269        }
    7370
    7471        Type * AdjustExprType::postmutate( FunctionType * functionType ) {
    75                 return new PointerType( Type::Qualifiers(), functionType );
     72                return new PointerType{ Type::Qualifiers(), functionType };
    7673        }
    7774
     
    8077                if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
    8178                        if ( eqvClass.data.kind == TypeDecl::Ftype ) {
    82                                 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
    83                                 return pointerType;
     79                                return new PointerType{ Type::Qualifiers(), typeInst };
    8480                        }
    8581                } else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
    8682                        if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
    8783                                if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
    88                                         PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
    89                                         return pointerType;
     84                                        return new PointerType{ Type::Qualifiers(), typeInst };
    9085                                } // if
    9186                        } // if
Note: See TracChangeset for help on using the changeset viewer.