Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r8abca06 r4071778  
    1010// Created On       : Thu Jul 19 12:52:41 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 11 15:09:18 2020
    13 // Update Count     : 10
     12// Last Modified On : Tue Jul 30 13:46:33 2019
     13// Update Count     : 3
    1414//
    1515
     
    1919#include "CodeGen/GenType.h"
    2020#include "Common/PassVisitor.h"
    21 #include "Common/utility.h"                                                             // isPrefix
    2221#include "Mangler.h"
    2322#include "SynTree/Type.h"
     
    367366                                // type variable types
    368367                                for (size_t k = 0; k < TypeDecl::NUMBER_OF_KINDS; ++k) {
    369                                         static const std::string typeVariableNames[] = { "DT", "OT", "FT", "TT", };
     368                                        static const std::string typeVariableNames[] = { "DT", "FT", "TT", };
    370369                                        static_assert(
    371370                                                sizeof(typeVariableNames)/sizeof(typeVariableNames[0]) == TypeDecl::NUMBER_OF_KINDS,
     
    417416
    418417                        bool StringView::isPrefix(const std::string & pref) {
    419                                 // if ( pref.size() > str.size()-idx ) return false;
    420                                 // auto its = std::mismatch( pref.begin(), pref.end(), std::next(str.begin(), idx) );
    421                                 // if (its.first == pref.end()) {
    422                                 //      idx += pref.size();
    423                                 //      return true;
    424                                 // }
    425 
    426                                 // This update is untested because there are no tests for this code.
    427                                 if ( ::isPrefix( str, pref, idx ) ) {
     418                                if ( pref.size() > str.size()-idx ) return false;
     419                                auto its = std::mismatch( pref.begin(), pref.end(), std::next(str.begin(), idx) );
     420                                if (its.first == pref.end()) {
    428421                                        idx += pref.size();
    429422                                        return true;
     
    436429                                PRINT( std::cerr << "====== " << str.size() << " " << str << std::endl; )
    437430                                if (str.size() < 2+Encoding::manglePrefix.size()) return false; // +2 for at least _1 suffix
    438                                 if ( ! isPrefix(Encoding::manglePrefix) || ! isdigit(str.back() ) ) return false;
     431                                if (! isPrefix(Encoding::manglePrefix) || ! isdigit(str.back())) return false;
    439432
    440433                                // get name
Note: See TracChangeset for help on using the changeset viewer.