Changeset eeaa3e2 for src/SymTab


Ignore:
Timestamp:
Feb 11, 2020, 4:14:46 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
921cd82
Parents:
0cc3c47 (diff), 8abca06 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r0cc3c47 reeaa3e2  
    1010// Created On       : Thu Jul 19 12:52:41 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 13 14:54:15 2019
    13 // Update Count     : 4
     12// Last Modified On : Tue Feb 11 15:09:18 2020
     13// Update Count     : 10
    1414//
    1515
     
    1919#include "CodeGen/GenType.h"
    2020#include "Common/PassVisitor.h"
     21#include "Common/utility.h"                                                             // isPrefix
    2122#include "Mangler.h"
    2223#include "SynTree/Type.h"
     
    416417
    417418                        bool StringView::isPrefix(const std::string & pref) {
    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()) {
     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 ) ) {
    421428                                        idx += pref.size();
    422429                                        return true;
     
    429436                                PRINT( std::cerr << "====== " << str.size() << " " << str << std::endl; )
    430437                                if (str.size() < 2+Encoding::manglePrefix.size()) return false; // +2 for at least _1 suffix
    431                                 if (! isPrefix(Encoding::manglePrefix) || ! isdigit(str.back())) return false;
     438                                if ( ! isPrefix(Encoding::manglePrefix) || ! isdigit(str.back() ) ) return false;
    432439
    433440                                // get name
Note: See TracChangeset for help on using the changeset viewer.