Changeset efa8b6a
- Timestamp:
- Aug 21, 2018, 8:53:11 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- cdbab55
- Parents:
- 72b3605
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Demangle.cc
r72b3605 refa8b6a 354 354 Type * parseUnion(Type::Qualifiers tq); 355 355 Type * parseEnum(Type::Qualifiers tq); 356 Type * parseType(Type::Qualifiers tq); 356 357 357 358 Type * parseType(); … … 390 391 parsers.emplace_back(Encoding::union_t, [this](Type::Qualifiers tq) { return parseUnion(tq); }); 391 392 parsers.emplace_back(Encoding::enum_t, [this](Type::Qualifiers tq) { return parseEnum(tq); }); 393 parsers.emplace_back(Encoding::type, [this](Type::Qualifiers tq) { return parseType(tq); }); 392 394 parsers.emplace_back(Encoding::zero, [this](Type::Qualifiers tq) { return new ZeroType(tq); }); 393 395 parsers.emplace_back(Encoding::one, [this](Type::Qualifiers tq) { return new OneType(tq); }); … … 396 398 bool StringView::extractNumber(size_t & out) { 397 399 std::stringstream numss; 400 if (idx >= str.size()) return false; 398 401 while (isdigit(str[idx])) { 399 402 numss << str[idx]; 400 403 ++idx; 401 if (idx >= str.size()) return false;404 if (idx == str.size()) break; 402 405 } 403 406 if (! (numss >> out)) return false; 407 PRINT( std::cerr << "extractNumber success: " << out << std::endl; ) 404 408 return true; 405 409 } … … 408 412 size_t len; 409 413 if (! extractNumber(len)) return false; 410 if (idx+len > =str.size()) return false;414 if (idx+len > str.size()) return false; 411 415 out = str.substr(idx, len); 412 416 idx += len; 417 PRINT( std::cerr << "extractName success: " << out << std::endl; ) 413 418 return true; 414 419 } … … 525 530 if (! extractName(name)) return nullptr; 526 531 return new EnumInstType(tq, name); 532 } 533 534 Type * StringView::parseType(Type::Qualifiers tq) { 535 PRINT( std::cerr << "type..." << std::endl; ) 536 std::string name; 537 if (! extractName(name)) return nullptr; 538 PRINT( std::cerr << "typename..." << name << std::endl; ) 539 return new TypeInstType(tq, name, false); 527 540 } 528 541
Note: See TracChangeset
for help on using the changeset viewer.