Changeset 8d182b1 for src/SymTab/Mangler.cc
- Timestamp:
- Nov 14, 2023, 12:19:09 PM (23 months ago)
- Branches:
- master
- Children:
- 1ccae59, 89a8bab
- Parents:
- df8ba61a (diff), 5625427 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Mangler.cc
rdf8ba61a r8d182b1 24 24 #include "AST/Pass.hpp" 25 25 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 26 #include "Common/PassVisitor.h"27 26 #include "Common/ToString.hpp" // for toCString 28 27 #include "Common/SemanticError.h" // for SemanticError 29 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment30 #include "SynTree/LinkageSpec.h" // for Spec, isOverridable, AutoGen, Int...31 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType32 #include "SynTree/Expression.h" // for TypeExpr, Expression, operator<<33 #include "SynTree/Type.h" // for Type, ReferenceToType, Type::Fora...34 35 namespace SymTab {36 namespace Mangler {37 namespace {38 /// Mangles names to a unique C identifier39 struct Mangler_old : public WithShortCircuiting, public WithVisitorRef<Mangler_old>, public WithGuards {40 Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams );41 Mangler_old( const Mangler_old & ) = delete;42 43 void previsit( const BaseSyntaxNode * ) { visit_children = false; }44 45 void postvisit( const ObjectDecl * declaration );46 void postvisit( const FunctionDecl * declaration );47 void postvisit( const TypeDecl * declaration );48 49 void postvisit( const VoidType * voidType );50 void postvisit( const BasicType * basicType );51 void postvisit( const PointerType * pointerType );52 void postvisit( const ArrayType * arrayType );53 void postvisit( const ReferenceType * refType );54 void postvisit( const FunctionType * functionType );55 void postvisit( const StructInstType * aggregateUseType );56 void postvisit( const UnionInstType * aggregateUseType );57 void postvisit( const EnumInstType * aggregateUseType );58 void postvisit( const TypeInstType * aggregateUseType );59 void postvisit( const TraitInstType * inst );60 void postvisit( const TupleType * tupleType );61 void postvisit( const VarArgsType * varArgsType );62 void postvisit( const ZeroType * zeroType );63 void postvisit( const OneType * oneType );64 void postvisit( const QualifiedType * qualType );65 66 std::string get_mangleName() { return mangleName; }67 private:68 std::string mangleName; ///< Mangled name being constructed69 typedef std::map< std::string, std::pair< int, int > > VarMapType;70 VarMapType varNums; ///< Map of type variables to indices71 int nextVarNum; ///< Next type variable index72 bool isTopLevel; ///< Is the Mangler at the top level73 bool mangleOverridable; ///< Specially mangle overridable built-in methods74 bool typeMode; ///< Produce a unique mangled name for a type75 bool mangleGenericParams; ///< Include generic parameters in name mangling if true76 bool inFunctionType = false; ///< Include type qualifiers if false.77 bool inQualifiedType = false; ///< Add start/end delimiters around qualified type78 79 public:80 Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams,81 int nextVarNum, const VarMapType& varNums );82 83 private:84 void mangleDecl( const DeclarationWithType * declaration );85 void mangleRef( const ReferenceToType * refType, std::string prefix );86 87 void printQualifiers( const Type *type );88 }; // Mangler_old89 } // namespace90 91 std::string mangle( const BaseSyntaxNode * decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) {92 PassVisitor<Mangler_old> mangler( mangleOverridable, typeMode, mangleGenericParams );93 maybeAccept( decl, mangler );94 return mangler.pass.get_mangleName();95 }96 97 std::string mangleType( const Type * ty ) {98 PassVisitor<Mangler_old> mangler( false, true, true );99 maybeAccept( ty, mangler );100 return mangler.pass.get_mangleName();101 }102 103 std::string mangleConcrete( const Type * ty ) {104 PassVisitor<Mangler_old> mangler( false, false, false );105 maybeAccept( ty, mangler );106 return mangler.pass.get_mangleName();107 }108 109 namespace {110 Mangler_old::Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams )111 : nextVarNum( 0 ), isTopLevel( true ),112 mangleOverridable( mangleOverridable ), typeMode( typeMode ),113 mangleGenericParams( mangleGenericParams ) {}114 115 Mangler_old::Mangler_old( bool mangleOverridable, bool typeMode, bool mangleGenericParams,116 int nextVarNum, const VarMapType& varNums )117 : varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ),118 mangleOverridable( mangleOverridable ), typeMode( typeMode ),119 mangleGenericParams( mangleGenericParams ) {}120 121 void Mangler_old::mangleDecl( const DeclarationWithType * declaration ) {122 bool wasTopLevel = isTopLevel;123 if ( isTopLevel ) {124 varNums.clear();125 nextVarNum = 0;126 isTopLevel = false;127 } // if128 mangleName += Encoding::manglePrefix;129 const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( declaration->get_name() );130 if ( opInfo ) {131 mangleName += std::to_string( opInfo->outputName.size() ) + opInfo->outputName;132 } else {133 mangleName += std::to_string( declaration->name.size() ) + declaration->name;134 } // if135 maybeAccept( declaration->get_type(), *visitor );136 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) {137 // want to be able to override autogenerated and intrinsic routines,138 // so they need a different name mangling139 if ( declaration->get_linkage() == LinkageSpec::AutoGen ) {140 mangleName += Encoding::autogen;141 } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) {142 mangleName += Encoding::intrinsic;143 } else {144 // if we add another kind of overridable function, this has to change145 assert( false && "unknown overrideable linkage" );146 } // if147 }148 isTopLevel = wasTopLevel;149 }150 151 void Mangler_old::postvisit( const ObjectDecl * declaration ) {152 mangleDecl( declaration );153 }154 155 void Mangler_old::postvisit( const FunctionDecl * declaration ) {156 mangleDecl( declaration );157 }158 159 void Mangler_old::postvisit( const VoidType * voidType ) {160 printQualifiers( voidType );161 mangleName += Encoding::void_t;162 }163 164 void Mangler_old::postvisit( const BasicType * basicType ) {165 printQualifiers( basicType );166 assertf( basicType->kind < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->kind );167 mangleName += Encoding::basicTypes[ basicType->kind ];168 }169 170 void Mangler_old::postvisit( const PointerType * pointerType ) {171 printQualifiers( pointerType );172 // mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers173 if ( ! dynamic_cast<FunctionType *>( pointerType->base ) ) mangleName += Encoding::pointer;174 maybeAccept( pointerType->base, *visitor );175 }176 177 void Mangler_old::postvisit( const ArrayType * arrayType ) {178 // TODO: encode dimension179 printQualifiers( arrayType );180 mangleName += Encoding::array + "0";181 maybeAccept( arrayType->base, *visitor );182 }183 184 void Mangler_old::postvisit( const ReferenceType * refType ) {185 // don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload.186 // Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.),187 // by pretending every reference type is a function parameter.188 GuardValue( inFunctionType );189 inFunctionType = true;190 printQualifiers( refType );191 maybeAccept( refType->base, *visitor );192 }193 194 namespace {195 inline std::list< Type* > getTypes( const std::list< DeclarationWithType* > decls ) {196 std::list< Type* > ret;197 std::transform( decls.begin(), decls.end(), std::back_inserter( ret ),198 std::mem_fun( &DeclarationWithType::get_type ) );199 return ret;200 }201 }202 203 void Mangler_old::postvisit( const FunctionType * functionType ) {204 printQualifiers( functionType );205 mangleName += Encoding::function;206 // turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters,207 // since qualifiers on outermost parameter type do not differentiate function types, e.g.,208 // void (*)(const int) and void (*)(int) are the same type, but void (*)(const int *) and void (*)(int *) are different209 GuardValue( inFunctionType );210 inFunctionType = true;211 std::list< Type* > returnTypes = getTypes( functionType->returnVals );212 if (returnTypes.empty()) mangleName += Encoding::void_t;213 else acceptAll( returnTypes, *visitor );214 mangleName += "_";215 std::list< Type* > paramTypes = getTypes( functionType->parameters );216 acceptAll( paramTypes, *visitor );217 mangleName += "_";218 }219 220 void Mangler_old::mangleRef( const ReferenceToType * refType, std::string prefix ) {221 printQualifiers( refType );222 223 mangleName += prefix + std::to_string( refType->name.length() ) + refType->name;224 225 if ( mangleGenericParams ) {226 const std::list< Expression* > & params = refType->parameters;227 if ( ! params.empty() ) {228 mangleName += "_";229 for ( const Expression * param : params ) {230 const TypeExpr * paramType = dynamic_cast< const TypeExpr * >( param );231 assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param));232 maybeAccept( paramType->type, *visitor );233 }234 mangleName += "_";235 }236 }237 }238 239 void Mangler_old::postvisit( const StructInstType * aggregateUseType ) {240 mangleRef( aggregateUseType, Encoding::struct_t );241 }242 243 void Mangler_old::postvisit( const UnionInstType * aggregateUseType ) {244 mangleRef( aggregateUseType, Encoding::union_t );245 }246 247 void Mangler_old::postvisit( const EnumInstType * aggregateUseType ) {248 mangleRef( aggregateUseType, Encoding::enum_t );249 }250 251 void Mangler_old::postvisit( const TypeInstType * typeInst ) {252 VarMapType::iterator varNum = varNums.find( typeInst->get_name() );253 if ( varNum == varNums.end() ) {254 mangleRef( typeInst, Encoding::type );255 } else {256 printQualifiers( typeInst );257 // Note: Can't use name here, since type variable names do not actually disambiguate a function, e.g.258 // forall(dtype T) void f(T);259 // forall(dtype S) void f(S);260 // are equivalent and should mangle the same way. This is accomplished by numbering the type variables when they261 // are first found and prefixing with the appropriate encoding for the type class.262 assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second );263 mangleName += Encoding::typeVariables[varNum->second.second] + std::to_string( varNum->second.first );264 } // if265 }266 267 void Mangler_old::postvisit( const TraitInstType * inst ) {268 printQualifiers( inst );269 mangleName += std::to_string( inst->name.size() ) + inst->name;270 }271 272 void Mangler_old::postvisit( const TupleType * tupleType ) {273 printQualifiers( tupleType );274 mangleName += Encoding::tuple + std::to_string( tupleType->types.size() );275 acceptAll( tupleType->types, *visitor );276 }277 278 void Mangler_old::postvisit( const VarArgsType * varArgsType ) {279 printQualifiers( varArgsType );280 static const std::string vargs = "__builtin_va_list";281 mangleName += Encoding::type + std::to_string( vargs.size() ) + vargs;282 }283 284 void Mangler_old::postvisit( const ZeroType * ) {285 mangleName += Encoding::zero;286 }287 288 void Mangler_old::postvisit( const OneType * ) {289 mangleName += Encoding::one;290 }291 292 void Mangler_old::postvisit( const QualifiedType * qualType ) {293 bool inqual = inQualifiedType;294 if (! inqual ) {295 // N marks the start of a qualified type296 inQualifiedType = true;297 mangleName += Encoding::qualifiedTypeStart;298 }299 maybeAccept( qualType->parent, *visitor );300 maybeAccept( qualType->child, *visitor );301 if ( ! inqual ) {302 // E marks the end of a qualified type303 inQualifiedType = false;304 mangleName += Encoding::qualifiedTypeEnd;305 }306 }307 308 void Mangler_old::postvisit( const TypeDecl * decl ) {309 // TODO: is there any case where mangling a TypeDecl makes sense? If so, this code needs to be310 // fixed to ensure that two TypeDecls mangle to the same name when they are the same type and vice versa.311 // Note: The current scheme may already work correctly for this case, I have not thought about this deeply312 // and the case has not yet come up in practice. Alternatively, if not then this code can be removed313 // aside from the assert false.314 assertf( false, "Mangler_old should not visit typedecl: %s", toCString(decl));315 assertf( decl->kind < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind );316 mangleName += Encoding::typeVariables[ decl->kind ] + std::to_string( decl->name.length() ) + decl->name;317 }318 319 __attribute__((unused)) void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) {320 for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) {321 os << i->first << "(" << i->second.first << "/" << i->second.second << ")" << std::endl;322 } // for323 }324 325 void Mangler_old::printQualifiers( const Type * type ) {326 // skip if not including qualifiers327 if ( typeMode ) return;328 if ( ! type->forall.empty() ) {329 std::list< std::string > assertionNames;330 int dcount = 0, fcount = 0, vcount = 0, acount = 0;331 mangleName += Encoding::forall;332 for ( const TypeDecl * i : type->forall ) {333 switch ( i->kind ) {334 case TypeDecl::Dtype:335 dcount++;336 break;337 case TypeDecl::Ftype:338 fcount++;339 break;340 case TypeDecl::Ttype:341 vcount++;342 break;343 default:344 assertf( false, "unimplemented kind for type variable %s", SymTab::Mangler::Encoding::typeVariables[i->kind].c_str() );345 } // switch346 varNums[ i->name ] = std::make_pair( nextVarNum, (int)i->kind );347 for ( const DeclarationWithType * assert : i->assertions ) {348 PassVisitor<Mangler_old> sub_mangler(349 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums );350 assert->accept( sub_mangler );351 assertionNames.push_back( sub_mangler.pass.get_mangleName() );352 acount++;353 } // for354 } // for355 mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";356 for(const auto & a : assertionNames) mangleName += a;357 // std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );358 mangleName += "_";359 } // if360 if ( ! inFunctionType ) {361 // these qualifiers do not distinguish the outermost type of a function parameter362 if ( type->get_const() ) {363 mangleName += Encoding::qualifiers.at(Type::Const);364 } // if365 if ( type->get_volatile() ) {366 mangleName += Encoding::qualifiers.at(Type::Volatile);367 } // if368 // Removed due to restrict not affecting function compatibility in GCC369 // if ( type->get_isRestrict() ) {370 // mangleName += "E";371 // } // if372 if ( type->get_atomic() ) {373 mangleName += Encoding::qualifiers.at(Type::Atomic);374 } // if375 }376 if ( type->get_mutex() ) {377 mangleName += Encoding::qualifiers.at(Type::Mutex);378 } // if379 if ( inFunctionType ) {380 // turn off inFunctionType so that types can be differentiated for nested qualifiers381 GuardValue( inFunctionType );382 inFunctionType = false;383 }384 }385 } // namespace386 } // namespace Mangler387 } // namespace SymTab388 28 389 29 namespace Mangle { 390 30 namespace { 391 31 /// Mangles names to a unique C identifier 392 struct Mangler _new : public ast::WithShortCircuiting, public ast::WithVisitorRef<Mangler_new>, public ast::WithGuards {393 Mangler _new( Mangle::Mode mode );394 Mangler _new( const Mangler_new& ) = delete;32 struct Mangler : public ast::WithShortCircuiting, public ast::WithVisitorRef<Mangler>, public ast::WithGuards { 33 Mangler( Mangle::Mode mode ); 34 Mangler( const Mangler & ) = delete; 395 35 396 36 void previsit( const ast::Node * ) { visit_children = false; } … … 432 72 433 73 private: 434 Mangler _new( bool mangleOverridable, bool typeMode, bool mangleGenericParams,74 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 435 75 int nextVarNum, const VarMapType& varNums ); 436 friend class ast::Pass<Mangler _new>;76 friend class ast::Pass<Mangler>; 437 77 438 78 private: … … 441 81 442 82 void printQualifiers( const ast::Type *type ); 443 }; // Mangler _new83 }; // Mangler 444 84 } // namespace 445 85 446 86 std::string mangle( const ast::Node * decl, Mangle::Mode mode ) { 447 return ast::Pass<Mangler _new>::read( decl, mode );87 return ast::Pass<Mangler>::read( decl, mode ); 448 88 } 449 89 450 90 namespace { 451 Mangler _new::Mangler_new( Mangle::Mode mode )91 Mangler::Mangler( Mangle::Mode mode ) 452 92 : nextVarNum( 0 ), isTopLevel( true ), 453 93 mangleOverridable ( ! mode.no_overrideable ), … … 455 95 mangleGenericParams( ! mode.no_generic_params ) {} 456 96 457 Mangler _new::Mangler_new( bool mangleOverridable, bool typeMode, bool mangleGenericParams,97 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 458 98 int nextVarNum, const VarMapType& varNums ) 459 99 : varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ), … … 461 101 mangleGenericParams( mangleGenericParams ) {} 462 102 463 void Mangler _new::mangleDecl( const ast::DeclWithType * decl ) {103 void Mangler::mangleDecl( const ast::DeclWithType * decl ) { 464 104 bool wasTopLevel = isTopLevel; 465 105 if ( isTopLevel ) { … … 491 131 } 492 132 493 void Mangler _new::postvisit( const ast::ObjectDecl * decl ) {133 void Mangler::postvisit( const ast::ObjectDecl * decl ) { 494 134 mangleDecl( decl ); 495 135 } 496 136 497 void Mangler _new::postvisit( const ast::FunctionDecl * decl ) {137 void Mangler::postvisit( const ast::FunctionDecl * decl ) { 498 138 mangleDecl( decl ); 499 139 } 500 140 501 void Mangler _new::postvisit( const ast::VoidType * voidType ) {141 void Mangler::postvisit( const ast::VoidType * voidType ) { 502 142 printQualifiers( voidType ); 503 143 mangleName += Encoding::void_t; 504 144 } 505 145 506 void Mangler _new::postvisit( const ast::BasicType * basicType ) {146 void Mangler::postvisit( const ast::BasicType * basicType ) { 507 147 printQualifiers( basicType ); 508 148 assertf( basicType->kind < ast::BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->kind ); … … 510 150 } 511 151 512 void Mangler _new::postvisit( const ast::PointerType * pointerType ) {152 void Mangler::postvisit( const ast::PointerType * pointerType ) { 513 153 printQualifiers( pointerType ); 514 154 // mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers … … 517 157 } 518 158 519 void Mangler _new::postvisit( const ast::ArrayType * arrayType ) {159 void Mangler::postvisit( const ast::ArrayType * arrayType ) { 520 160 // TODO: encode dimension 521 161 printQualifiers( arrayType ); … … 524 164 } 525 165 526 void Mangler _new::postvisit( const ast::ReferenceType * refType ) {166 void Mangler::postvisit( const ast::ReferenceType * refType ) { 527 167 // don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload. 528 168 // Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.), … … 534 174 } 535 175 536 void Mangler _new::postvisit( const ast::FunctionType * functionType ) {176 void Mangler::postvisit( const ast::FunctionType * functionType ) { 537 177 printQualifiers( functionType ); 538 178 mangleName += Encoding::function; … … 549 189 } 550 190 551 void Mangler _new::mangleRef(191 void Mangler::mangleRef( 552 192 const ast::BaseInstType * refType, const std::string & prefix ) { 553 193 printQualifiers( refType ); … … 566 206 } 567 207 568 void Mangler _new::postvisit( const ast::StructInstType * aggregateUseType ) {208 void Mangler::postvisit( const ast::StructInstType * aggregateUseType ) { 569 209 mangleRef( aggregateUseType, Encoding::struct_t ); 570 210 } 571 211 572 void Mangler _new::postvisit( const ast::UnionInstType * aggregateUseType ) {212 void Mangler::postvisit( const ast::UnionInstType * aggregateUseType ) { 573 213 mangleRef( aggregateUseType, Encoding::union_t ); 574 214 } 575 215 576 void Mangler _new::postvisit( const ast::EnumInstType * aggregateUseType ) {216 void Mangler::postvisit( const ast::EnumInstType * aggregateUseType ) { 577 217 mangleRef( aggregateUseType, Encoding::enum_t ); 578 218 } 579 219 580 void Mangler _new::postvisit( const ast::TypeInstType * typeInst ) {220 void Mangler::postvisit( const ast::TypeInstType * typeInst ) { 581 221 VarMapType::iterator varNum = varNums.find( typeInst->name ); 582 222 if ( varNum == varNums.end() ) { … … 594 234 } 595 235 596 void Mangler _new::postvisit( const ast::TraitInstType * inst ) {236 void Mangler::postvisit( const ast::TraitInstType * inst ) { 597 237 printQualifiers( inst ); 598 238 mangleName += std::to_string( inst->name.size() ) + inst->name; 599 239 } 600 240 601 void Mangler _new::postvisit( const ast::TupleType * tupleType ) {241 void Mangler::postvisit( const ast::TupleType * tupleType ) { 602 242 printQualifiers( tupleType ); 603 243 mangleName += Encoding::tuple + std::to_string( tupleType->types.size() ); … … 605 245 } 606 246 607 void Mangler _new::postvisit( const ast::VarArgsType * varArgsType ) {247 void Mangler::postvisit( const ast::VarArgsType * varArgsType ) { 608 248 printQualifiers( varArgsType ); 609 249 static const std::string vargs = "__builtin_va_list"; … … 611 251 } 612 252 613 void Mangler _new::postvisit( const ast::ZeroType * ) {253 void Mangler::postvisit( const ast::ZeroType * ) { 614 254 mangleName += Encoding::zero; 615 255 } 616 256 617 void Mangler _new::postvisit( const ast::OneType * ) {257 void Mangler::postvisit( const ast::OneType * ) { 618 258 mangleName += Encoding::one; 619 259 } 620 260 621 void Mangler _new::postvisit( const ast::QualifiedType * qualType ) {261 void Mangler::postvisit( const ast::QualifiedType * qualType ) { 622 262 bool inqual = inQualifiedType; 623 263 if ( !inqual ) { … … 635 275 } 636 276 637 void Mangler _new::postvisit( const ast::TypeDecl * decl ) {277 void Mangler::postvisit( const ast::TypeDecl * decl ) { 638 278 // TODO: is there any case where mangling a TypeDecl makes sense? If so, this code needs to be 639 279 // fixed to ensure that two TypeDecls mangle to the same name when they are the same type and vice versa. … … 641 281 // and the case has not yet come up in practice. Alternatively, if not then this code can be removed 642 282 // aside from the assert false. 643 assertf(false, "Mangler _newshould not visit typedecl: %s", toCString(decl));283 assertf(false, "Mangler should not visit typedecl: %s", toCString(decl)); 644 284 assertf( decl->kind < ast::TypeDecl::Kind::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->kind ); 645 285 mangleName += Encoding::typeVariables[ decl->kind ] + std::to_string( decl->name.length() ) + decl->name; … … 653 293 } 654 294 655 void Mangler _new::printQualifiers( const ast::Type * type ) {295 void Mangler::printQualifiers( const ast::Type * type ) { 656 296 // skip if not including qualifiers 657 297 if ( typeMode ) return; … … 678 318 } // for 679 319 for ( auto & assert : funcType->assertions ) { 680 assertionNames.push_back( ast::Pass<Mangler _new>::read(320 assertionNames.push_back( ast::Pass<Mangler>::read( 681 321 assert->var.get(), 682 322 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ) );
Note:
See TracChangeset
for help on using the changeset viewer.