Changeset 361bf01 for src/AST/Type.cpp
- Timestamp:
- Dec 11, 2020, 11:20:45 PM (4 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.cpp
ra6e0e4c r361bf01 94 94 // --- ParameterizedType 95 95 96 void ParameterizedType::initWithSub(97 const ParameterizedType & o, Pass< ForallSubstitutor > & sub96 void FunctionType::initWithSub( 97 const FunctionType & o, Pass< ForallSubstitutor > & sub 98 98 ) { 99 99 forall = sub.core( o.forall ); … … 104 104 105 105 FunctionType::FunctionType( const FunctionType & o ) 106 : ParameterizedType( o.qualifiers, copy( o.attributes ) ), returns(), params(),106 : Type( o.qualifiers, copy( o.attributes ) ), returns(), params(), 107 107 isVarArgs( o.isVarArgs ) { 108 108 Pass< ForallSubstitutor > sub; … … 125 125 } 126 126 127 // --- BaseInstType128 129 void BaseInstType::initWithSub( const BaseInstType & o, Pass< ForallSubstitutor > & sub ) {130 ParameterizedType::initWithSub( o, sub ); // initialize substitution131 params = sub.core( o.params ); // apply to parameters132 }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 141 127 std::vector<readonly<Decl>> BaseInstType::lookup( const std::string& name ) const { 142 128 assertf( aggr(), "Must have aggregate to perform lookup" ); … … 176 162 const TraitDecl * b, CV::Qualifiers q, std::vector<ptr<Attribute>>&& as ) 177 163 : BaseInstType( b->name, q, move(as) ), base( b ) {} 178 179 // --- TypeInstType180 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 substitution185 base = sub.core( o.base ); // apply to base type186 }187 164 188 165 void TypeInstType::set_base( const TypeDecl * b ) {
Note: See TracChangeset
for help on using the changeset viewer.