Changeset 550e819


Ignore:
Timestamp:
Aug 20, 2018, 1:30:04 PM (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:
39c4dac
Parents:
0e761e40
Message:

Fix demangling for type variable parameters and temporarily skip demangling functions with assertion parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r0e761e40 r550e819  
    369369                                // type variable types
    370370                                for (size_t k = 0; k < TypeDecl::NUMBER_OF_KINDS; ++k) {
     371                                        static const std::string typeVariableNames[] = { "DT", "FT", "TT", };
     372                                        static_assert(
     373                                                sizeof(typeVariableNames)/sizeof(typeVariableNames[0]) == TypeDecl::NUMBER_OF_KINDS,
     374                                                "Each type variable kind should have a demangle name prefix"
     375                                        );
    371376                                        parsers.emplace_back(Encoding::typeVariables[k], [k, this](Type::Qualifiers tq) -> TypeInstType * {
    372377                                                PRINT( std::cerr << "type variable type: " << k << std::endl; )
    373                                                 std::string name;
    374                                                 if (! extractName(name)) return nullptr;
    375                                                 return new TypeInstType(tq, name, (TypeDecl::Kind)k != TypeDecl::Ftype);
     378                                                size_t N;
     379                                                if (! extractNumber(N)) return nullptr;
     380                                                return new TypeInstType(tq, toString(typeVariableNames[k], N), (TypeDecl::Kind)k != TypeDecl::Ftype);
    376381                                        });
    377382                                }
     
    541546                                        PRINT( std::cerr << acount << " assertions" << std::endl; )
    542547                                        if (! expect('_')) return nullptr;
    543                                         // recursively(?) parse `acount` assertions
     548                                        for (size_t i = 0; i < acount; ++i) {
     549                                                // TODO: need to recursively parse assertions, but for now just return nullptr so that
     550                                                // demangler does not crash if there are assertions
     551                                                return nullptr;
     552                                        }
    544553                                        if (! expect('_')) return nullptr;
    545554                                }
Note: See TracChangeset for help on using the changeset viewer.