Changeset 00ac42e for src/ResolvExpr/AdjustExprType.cc
- Timestamp:
- Jun 1, 2018, 2:54:55 PM (7 years ago)
- 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, with_gc
- Children:
- 262bd63
- Parents:
- 41e16b1
- git-author:
- Aaron Moss <a3moss@…> (05/31/18 16:24:49)
- git-committer:
- Aaron Moss <a3moss@…> (06/01/18 14:54:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AdjustExprType.cc
r41e16b1 r00ac42e 66 66 67 67 Type * AdjustExprType::postmutate( ArrayType * arrayType ) { 68 PointerType *pointerType = new PointerType ( arrayType->get_qualifiers(), arrayType->base );68 PointerType *pointerType = new PointerType{ arrayType->get_qualifiers(), arrayType->base }; 69 69 arrayType->base = nullptr; 70 70 delete arrayType; … … 73 73 74 74 Type * AdjustExprType::postmutate( FunctionType * functionType ) { 75 return new PointerType ( Type::Qualifiers(), functionType );75 return new PointerType{ Type::Qualifiers(), functionType }; 76 76 } 77 77 78 78 Type * AdjustExprType::postmutate( TypeInstType * typeInst ) { 79 EqvClass eqvClass; 80 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 81 if ( eqvClass.data.kind == TypeDecl::Ftype ) { 82 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 83 return pointerType; 79 if ( const EqvClass* eqvClass = env.lookup( typeInst->get_name() ) ) { 80 if ( eqvClass->data.kind == TypeDecl::Ftype ) { 81 return new PointerType{ Type::Qualifiers(), typeInst }; 84 82 } 85 83 } else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 86 84 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { 87 85 if ( tyDecl->get_kind() == TypeDecl::Ftype ) { 88 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 89 return pointerType; 86 return new PointerType{ Type::Qualifiers(), typeInst }; 90 87 } // if 91 88 } // if
Note: See TracChangeset
for help on using the changeset viewer.