Changeset 361bf01 for src/AST/Type.cpp


Ignore:
Timestamp:
Dec 11, 2020, 11:20:45 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5b9a0ae
Parents:
a6e0e4c
Message:

remove ParameterizedType? and put content into FunctionType?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Type.cpp

    ra6e0e4c r361bf01  
    9494// --- ParameterizedType
    9595
    96 void ParameterizedType::initWithSub(
    97         const ParameterizedType & o, Pass< ForallSubstitutor > & sub
     96void FunctionType::initWithSub(
     97        const FunctionType & o, Pass< ForallSubstitutor > & sub
    9898) {
    9999        forall = sub.core( o.forall );
     
    104104
    105105FunctionType::FunctionType( const FunctionType & o )
    106 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), returns(), params(),
     106: Type( o.qualifiers, copy( o.attributes ) ), returns(), params(),
    107107  isVarArgs( o.isVarArgs ) {
    108108        Pass< ForallSubstitutor > sub;
     
    125125}
    126126
    127 // --- BaseInstType
    128 
    129 void BaseInstType::initWithSub( const BaseInstType & o, Pass< ForallSubstitutor > & sub ) {
    130         ParameterizedType::initWithSub( o, sub ); // initialize substitution
    131         params = sub.core( o.params );            // apply to parameters
    132 }
    133 
    134 BaseInstType::BaseInstType( const BaseInstType & o )
    135 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), params(), name( o.name ),
    136   hoistType( o.hoistType ) {
    137         Pass< ForallSubstitutor > sub;
    138         initWithSub( o, sub );
    139 }
    140 
    141127std::vector<readonly<Decl>> BaseInstType::lookup( const std::string& name ) const {
    142128        assertf( aggr(), "Must have aggregate to perform lookup" );
     
    176162        const TraitDecl * b, CV::Qualifiers q, std::vector<ptr<Attribute>>&& as )
    177163: BaseInstType( b->name, q, move(as) ), base( b ) {}
    178 
    179 // --- TypeInstType
    180 
    181 TypeInstType::TypeInstType( const TypeInstType & o )
    182 : BaseInstType( o.name, o.qualifiers, copy( o.attributes ) ), base(), kind( o.kind ) {
    183         Pass< ForallSubstitutor > sub;
    184         initWithSub( o, sub );      // initialize substitution
    185         base = sub.core( o.base );  // apply to base type
    186 }
    187164
    188165void TypeInstType::set_base( const TypeDecl * b ) {
Note: See TracChangeset for help on using the changeset viewer.