Changeset 2f9768f for src


Ignore:
Timestamp:
Aug 19, 2018, 10:56:12 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
38587bc
Parents:
90ed538
Message:

Parse array types in demangler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r90ed538 r2f9768f  
    350350                                Type * parseVoid(Type::Qualifiers tq);
    351351                                Type * parsePointer(Type::Qualifiers tq);
     352                                Type * parseArray(Type::Qualifiers tq);
    352353                                Type * parseStruct(Type::Qualifiers tq);
    353354
     
    368369                                parsers.emplace_back(Encoding::function, [this](Type::Qualifiers tq) { return parseFunction(tq); });
    369370                                parsers.emplace_back(Encoding::pointer, [this](Type::Qualifiers tq) { return parsePointer(tq); });
     371                                parsers.emplace_back(Encoding::array, [this](Type::Qualifiers tq) { return parseArray(tq); });
    370372                                parsers.emplace_back(Encoding::tuple, [this](Type::Qualifiers tq) { return parseTuple(tq); });
    371373                                parsers.emplace_back(Encoding::struct_t, [this](Type::Qualifiers tq) { return parseStruct(tq); });
     
    475477                        }
    476478
     479                        Type * StringView::parseArray(Type::Qualifiers tq) {
     480                                PRINT( std::cerr << "array..." << std::endl; )
     481                                size_t length;
     482                                if (! extractNumber(length)) return nullptr;
     483                                Type * t = parseType();
     484                                if (! t) return nullptr;
     485                                return new ArrayType( tq, t, new ConstantExpr( Constant::from_ulong(length) ), false, false );
     486                        }
     487
    477488                        Type * StringView::parseStruct(Type::Qualifiers tq) {
    478489                                PRINT( std::cerr << "struct..." << std::endl; )
Note: See TracChangeset for help on using the changeset viewer.