Changeset 04c77791
- Timestamp:
- Aug 19, 2018, 12:09:36 PM (6 years ago)
- 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:
- 2987b30
- Parents:
- 0e73845
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Demangle.cc
r0e73845 r04c77791 23 23 #include "SynTree/Declaration.h" 24 24 25 //#define DEBUG25 #define DEBUG 26 26 #ifdef DEBUG 27 27 #define PRINT(x) x … … 365 365 PRINT( std::cerr << "basic type: " << k << std::endl; ) 366 366 return new BasicType(tq, (BasicType::Kind)k); 367 }); 368 } 369 // type variable types 370 for (size_t k = 0; k < TypeDecl::NUMBER_OF_KINDS; ++k) { 371 parsers.emplace_back(Encoding::typeVariables[k], [k, this](Type::Qualifiers tq) -> TypeInstType * { 372 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); 367 376 }); 368 377 } … … 516 525 if (done()) return nullptr; 517 526 527 std::list<TypeDecl *> forall; 528 if (isPrefix(Encoding::forall)) { 529 PRINT( std::cerr << "polymorphic with..." << std::endl; ) 530 size_t dcount, fcount, vcount, acount; 531 if (! extractNumber(dcount)) return nullptr; 532 PRINT( std::cerr << dcount << " dtypes" << std::endl; ) 533 if (! expect('_')) return nullptr; 534 if (! extractNumber(fcount)) return nullptr; 535 PRINT( std::cerr << fcount << " ftypes" << std::endl; ) 536 if (! expect('_')) return nullptr; 537 if (! extractNumber(vcount)) return nullptr; 538 PRINT( std::cerr << vcount << " ttypes" << std::endl; ) 539 if (! expect('_')) return nullptr; 540 if (! extractNumber(acount)) return nullptr; 541 PRINT( std::cerr << acount << " assertions" << std::endl; ) 542 if (! expect('_')) return nullptr; 543 // recursively(?) parse `acount` assertions 544 if (! expect('_')) return nullptr; 545 } 546 518 547 // qualifiers 519 548 Type::Qualifiers tq; … … 531 560 }); 532 561 assertf(iter != parsers.end(), "Unhandled type letter: %c at index: %zd", cur(), idx); 533 return iter->second(tq); 562 Type * ret = iter->second(tq); 563 if (! ret) return nullptr; 564 ret->forall = std::move(forall); 565 return ret; 534 566 } 535 567
Note: See TracChangeset
for help on using the changeset viewer.