Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Target / MemoryHistory.cpp
blob0ebf796a56bbd20756ecfe784f2937fea298df0d
1 //===-- MemoryHistory.cpp -------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Target/MemoryHistory.h"
10 #include "lldb/Core/PluginManager.h"
12 using namespace lldb;
13 using namespace lldb_private;
15 lldb::MemoryHistorySP MemoryHistory::FindPlugin(const ProcessSP process) {
16 MemoryHistoryCreateInstance create_callback = nullptr;
18 for (uint32_t idx = 0;
19 (create_callback = PluginManager::GetMemoryHistoryCreateCallbackAtIndex(
20 idx)) != nullptr;
21 ++idx) {
22 MemoryHistorySP memory_history_sp(create_callback(process));
23 if (memory_history_sp)
24 return memory_history_sp;
27 return MemoryHistorySP();