Ignore:
Timestamp:
May 15, 2017, 11:30:26 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
d36c117
Parents:
65aca88
Message:

initial work on references: reference types passed through the system, very simple examples work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    r65aca88 rce8c12f  
    3030          case Unknown:
    3131          case Pointer:
     32          case Reference:
    3233          case EnumConstant:
    3334                // nothing else to initialize
     
    99100          case Unknown:
    100101          case Pointer:
     102          case Reference:
    101103          case EnumConstant:
    102104                // nothing to destroy
     
    165167          case EnumConstant:
    166168          case Pointer:
     169          case Reference:
    167170                // nothing else to copy
    168171                break;
     
    434437          case TypeData::Array:
    435438                return buildArray( td );
     439          case TypeData::Reference:
     440                return buildReference( td );
    436441          case TypeData::Function:
    437442                return buildFunction( td );
     
    612617        buildForall( td->forall, at->get_forall() );
    613618        return at;
    614 } // buildPointer
     619} // buildArray
     620
     621ReferenceType * buildReference( const TypeData * td ) {
     622        ReferenceType * rt;
     623        if ( td->base ) {
     624                rt = new ReferenceType( buildQualifiers( td ), typebuild( td->base ) );
     625        } else {
     626                rt = new ReferenceType( buildQualifiers( td ), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
     627        } // if
     628        buildForall( td->forall, rt->get_forall() );
     629        return rt;
     630} // buildReference
    615631
    616632AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes ) {
Note: See TracChangeset for help on using the changeset viewer.