Ignore:
Timestamp:
Oct 31, 2023, 2:53:39 PM (7 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
6e7ed0aa
Parents:
58c64323
Message:

Took out some old code from the new section of the Mangler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    r58c64323 ra137d5a  
    2222#include <string>                        // for string, char_traits, operator<<
    2323
     24#include "AST/Pass.hpp"
    2425#include "CodeGen/OperatorTable.h"       // for OperatorInfo, operatorLookup
    2526#include "Common/PassVisitor.h"
     
    3132#include "SynTree/Expression.h"          // for TypeExpr, Expression, operator<<
    3233#include "SynTree/Type.h"                // for Type, ReferenceToType, Type::Fora...
    33 
    34 #include "AST/Pass.hpp"
    3534
    3635namespace SymTab {
     
    476475                                mangleName += std::to_string( decl->name.size() ) + decl->name;
    477476                        } // if
    478                         maybeAccept( decl->get_type(), *visitor );
     477                        decl->get_type()->accept( *visitor );
    479478                        if ( mangleOverridable && decl->linkage.is_overrideable ) {
    480479                                // want to be able to override autogenerated and intrinsic routines,
     
    522521                        printQualifiers( arrayType );
    523522                        mangleName += Encoding::array + "0";
    524                         maybeAccept( arrayType->base.get(), *visitor );
     523                        arrayType->base->accept( *visitor );
    525524                }
    526525
     
    532531                        inFunctionType = true;
    533532                        printQualifiers( refType );
    534                         maybeAccept( refType->base.get(), *visitor );
     533                        refType->base->accept( *visitor );
    535534                }
    536535
     
    561560                                        auto paramType = dynamic_cast< const ast::TypeExpr * >( param );
    562561                                        assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param));
    563                                         maybeAccept( paramType->type.get(), *visitor );
     562                                        paramType->type->accept( *visitor );
    564563                                }
    565564                                mangleName += "_";
     
    590589                                // are equivalent and should mangle the same way. This is accomplished by numbering the type variables when they
    591590                                // 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 );
    593592                                mangleName += Encoding::typeVariables[varNum->second.second] + std::to_string( varNum->second.first );
    594593                        } // if
     
    622621                void Mangler_new::postvisit( const ast::QualifiedType * qualType ) {
    623622                        bool inqual = inQualifiedType;
    624                         if (! inqual ) {
     623                        if ( !inqual ) {
    625624                                // N marks the start of a qualified type
    626625                                inQualifiedType = true;
    627626                                mangleName += Encoding::qualifiedTypeStart;
    628627                        }
    629                         maybeAccept( qualType->parent.get(), *visitor );
    630                         maybeAccept( qualType->child.get(), *visitor );
    631                         if ( ! inqual ) {
     628                        qualType->parent->accept( *visitor );
     629                        qualType->child->accept( *visitor );
     630                        if ( !inqual ) {
    632631                                // E marks the end of a qualified type
    633632                                inQualifiedType = false;
     
    691690                                // these qualifiers do not distinguish the outermost type of a function parameter
    692691                                if ( type->is_const() ) {
    693                                         mangleName += Encoding::qualifiers.at(Type::Const);
     692                                        mangleName += Encoding::qualifiers.at( ast::CV::Const );
    694693                                } // if
    695694                                if ( type->is_volatile() ) {
    696                                         mangleName += Encoding::qualifiers.at(Type::Volatile);
     695                                        mangleName += Encoding::qualifiers.at( ast::CV::Volatile );
    697696                                } // if
    698697                                // Removed due to restrict not affecting function compatibility in GCC
     
    701700                                // } // if
    702701                                if ( type->is_atomic() ) {
    703                                         mangleName += Encoding::qualifiers.at(Type::Atomic);
     702                                        mangleName += Encoding::qualifiers.at( ast::CV::Atomic );
    704703                                } // if
    705704                        }
    706705                        if ( type->is_mutex() ) {
    707                                 mangleName += Encoding::qualifiers.at(Type::Mutex);
     706                                mangleName += Encoding::qualifiers.at( ast::CV::Mutex );
    708707                        } // if
    709708                        if ( inFunctionType ) {
Note: See TracChangeset for help on using the changeset viewer.