Changeset a137d5a
- Timestamp:
- Oct 31, 2023, 2:53:39 PM (14 months ago)
- Branches:
- master
- Children:
- 6e7ed0aa
- Parents:
- 58c64323
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Mangler.cc
r58c64323 ra137d5a 22 22 #include <string> // for string, char_traits, operator<< 23 23 24 #include "AST/Pass.hpp" 24 25 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 25 26 #include "Common/PassVisitor.h" … … 31 32 #include "SynTree/Expression.h" // for TypeExpr, Expression, operator<< 32 33 #include "SynTree/Type.h" // for Type, ReferenceToType, Type::Fora... 33 34 #include "AST/Pass.hpp"35 34 36 35 namespace SymTab { … … 476 475 mangleName += std::to_string( decl->name.size() ) + decl->name; 477 476 } // if 478 maybeAccept( decl->get_type(),*visitor );477 decl->get_type()->accept( *visitor ); 479 478 if ( mangleOverridable && decl->linkage.is_overrideable ) { 480 479 // want to be able to override autogenerated and intrinsic routines, … … 522 521 printQualifiers( arrayType ); 523 522 mangleName += Encoding::array + "0"; 524 maybeAccept( arrayType->base.get(),*visitor );523 arrayType->base->accept( *visitor ); 525 524 } 526 525 … … 532 531 inFunctionType = true; 533 532 printQualifiers( refType ); 534 maybeAccept( refType->base.get(),*visitor );533 refType->base->accept( *visitor ); 535 534 } 536 535 … … 561 560 auto paramType = dynamic_cast< const ast::TypeExpr * >( param ); 562 561 assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param)); 563 maybeAccept( paramType->type.get(),*visitor );562 paramType->type->accept( *visitor ); 564 563 } 565 564 mangleName += "_"; … … 590 589 // are equivalent and should mangle the same way. This is accomplished by numbering the type variables when they 591 590 // are first found and prefixing with the appropriate encoding for the type class. 592 assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second );591 assertf( varNum->second.second < ast::TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second ); 593 592 mangleName += Encoding::typeVariables[varNum->second.second] + std::to_string( varNum->second.first ); 594 593 } // if … … 622 621 void Mangler_new::postvisit( const ast::QualifiedType * qualType ) { 623 622 bool inqual = inQualifiedType; 624 if ( !inqual ) {623 if ( !inqual ) { 625 624 // N marks the start of a qualified type 626 625 inQualifiedType = true; 627 626 mangleName += Encoding::qualifiedTypeStart; 628 627 } 629 maybeAccept( qualType->parent.get(),*visitor );630 maybeAccept( qualType->child.get(),*visitor );631 if ( ! 628 qualType->parent->accept( *visitor ); 629 qualType->child->accept( *visitor ); 630 if ( !inqual ) { 632 631 // E marks the end of a qualified type 633 632 inQualifiedType = false; … … 691 690 // these qualifiers do not distinguish the outermost type of a function parameter 692 691 if ( type->is_const() ) { 693 mangleName += Encoding::qualifiers.at( Type::Const);692 mangleName += Encoding::qualifiers.at( ast::CV::Const ); 694 693 } // if 695 694 if ( type->is_volatile() ) { 696 mangleName += Encoding::qualifiers.at( Type::Volatile);695 mangleName += Encoding::qualifiers.at( ast::CV::Volatile ); 697 696 } // if 698 697 // Removed due to restrict not affecting function compatibility in GCC … … 701 700 // } // if 702 701 if ( type->is_atomic() ) { 703 mangleName += Encoding::qualifiers.at( Type::Atomic);702 mangleName += Encoding::qualifiers.at( ast::CV::Atomic ); 704 703 } // if 705 704 } 706 705 if ( type->is_mutex() ) { 707 mangleName += Encoding::qualifiers.at( Type::Mutex);706 mangleName += Encoding::qualifiers.at( ast::CV::Mutex ); 708 707 } // if 709 708 if ( inFunctionType ) {
Note: See TracChangeset
for help on using the changeset viewer.