Changeset 0698aa1 for src/SynTree/Expression.cc
- Timestamp:
- Jul 12, 2017, 4:44:44 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, resolv-new, with_gc
- Children:
- cda7889
- Parents:
- aca65621
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
raca65621 r0698aa1 335 335 namespace { 336 336 TypeSubstitution makeSub( Type * t ) { 337 if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 337 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) { 338 return makeSub( refType->get_base() ); 339 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 338 340 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() ); 339 341 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) { … … 400 402 if ( Type * type = expr->get_result() ) { 401 403 Type * base = InitTweak::getPointerBase( type ); 402 if ( ! base ) { 403 std::cerr << type << std::endl; 404 } 405 assertf( base, "expected pointer type in dereference\n" ); 406 ret->set_result( maybeClone( base ) ); 404 assertf( base, "expected pointer type in dereference (type was %s)", toString( type ).c_str() ); 405 ret->set_result( new ReferenceType( Type::Qualifiers(), base->clone() ) ); 407 406 } 408 407 return ret;
Note: See TracChangeset
for help on using the changeset viewer.