|
21 | 21 | #include "lldb/Utility/DataExtractor.h"
|
22 | 22 | #include "lldb/Utility/Stream.h"
|
23 | 23 | #include "lldb/Utility/Timer.h"
|
| 24 | +#include "lldb/lldb-private-enumerations.h" |
24 | 25 | #include "llvm/Support/FormatVariadic.h"
|
25 | 26 | #include "llvm/Support/ThreadPool.h"
|
26 | 27 | #include <atomic>
|
@@ -471,60 +472,62 @@ void ManualDWARFIndex::GetNamespaces(
|
471 | 472 | void ManualDWARFIndex::GetFunctions(
|
472 | 473 | const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf,
|
473 | 474 | const CompilerDeclContext &parent_decl_ctx,
|
474 |
| - llvm::function_ref<bool(DWARFDIE die)> callback) { |
| 475 | + llvm::function_ref<IterationAction(DWARFDIE die)> callback) { |
475 | 476 | Index();
|
476 | 477 | ConstString name = lookup_info.GetLookupName();
|
477 | 478 | FunctionNameType name_type_mask = lookup_info.GetNameTypeMask();
|
478 | 479 |
|
479 | 480 | if (name_type_mask & eFunctionNameTypeFull) {
|
480 | 481 | if (!m_set.function_fullnames.Find(
|
481 |
| - name, DIERefCallback( |
482 |
| - [&](DWARFDIE die) { |
483 |
| - if (!SymbolFileDWARF::DIEInDeclContext(parent_decl_ctx, |
484 |
| - die)) |
485 |
| - return true; |
486 |
| - return callback(die); |
487 |
| - }, |
488 |
| - name.GetStringRef()))) |
| 482 | + name, DIERefCallback(IterationActionAdaptor([&](DWARFDIE die) { |
| 483 | + if (!SymbolFileDWARF::DIEInDeclContext( |
| 484 | + parent_decl_ctx, die)) |
| 485 | + return IterationAction::Continue; |
| 486 | + return callback(die); |
| 487 | + }), |
| 488 | + name.GetStringRef()))) |
489 | 489 | return;
|
490 | 490 | }
|
491 | 491 | if (name_type_mask & eFunctionNameTypeBase) {
|
492 | 492 | if (!m_set.function_basenames.Find(
|
493 |
| - name, DIERefCallback( |
494 |
| - [&](DWARFDIE die) { |
495 |
| - if (!SymbolFileDWARF::DIEInDeclContext(parent_decl_ctx, |
496 |
| - die)) |
497 |
| - return true; |
498 |
| - return callback(die); |
499 |
| - }, |
500 |
| - name.GetStringRef()))) |
| 493 | + name, DIERefCallback(IterationActionAdaptor([&](DWARFDIE die) { |
| 494 | + if (!SymbolFileDWARF::DIEInDeclContext( |
| 495 | + parent_decl_ctx, die)) |
| 496 | + return IterationAction::Continue; |
| 497 | + return callback(die); |
| 498 | + }), |
| 499 | + name.GetStringRef()))) |
501 | 500 | return;
|
502 | 501 | }
|
503 | 502 |
|
504 | 503 | if (name_type_mask & eFunctionNameTypeMethod && !parent_decl_ctx.IsValid()) {
|
505 | 504 | if (!m_set.function_methods.Find(
|
506 |
| - name, DIERefCallback(callback, name.GetStringRef()))) |
| 505 | + name, DIERefCallback(IterationActionAdaptor(callback), |
| 506 | + name.GetStringRef()))) |
507 | 507 | return;
|
508 | 508 | }
|
509 | 509 |
|
510 | 510 | if (name_type_mask & eFunctionNameTypeSelector &&
|
511 | 511 | !parent_decl_ctx.IsValid()) {
|
512 | 512 | if (!m_set.function_selectors.Find(
|
513 |
| - name, DIERefCallback(callback, name.GetStringRef()))) |
| 513 | + name, DIERefCallback(IterationActionAdaptor(callback), |
| 514 | + name.GetStringRef()))) |
514 | 515 | return;
|
515 | 516 | }
|
516 | 517 | }
|
517 | 518 |
|
518 | 519 | void ManualDWARFIndex::GetFunctions(
|
519 | 520 | const RegularExpression ®ex,
|
520 |
| - llvm::function_ref<bool(DWARFDIE die)> callback) { |
| 521 | + llvm::function_ref<IterationAction(DWARFDIE die)> callback) { |
521 | 522 | Index();
|
522 | 523 |
|
523 |
| - if (!m_set.function_basenames.Find(regex, |
524 |
| - DIERefCallback(callback, regex.GetText()))) |
| 524 | + if (!m_set.function_basenames.Find( |
| 525 | + regex, |
| 526 | + DIERefCallback(IterationActionAdaptor(callback), regex.GetText()))) |
525 | 527 | return;
|
526 |
| - if (!m_set.function_fullnames.Find(regex, |
527 |
| - DIERefCallback(callback, regex.GetText()))) |
| 528 | + if (!m_set.function_fullnames.Find( |
| 529 | + regex, |
| 530 | + DIERefCallback(IterationActionAdaptor(callback), regex.GetText()))) |
528 | 531 | return;
|
529 | 532 | }
|
530 | 533 |
|
|
0 commit comments