Jason Molenda | ea0dbca | 2010-09-22 07:37:07 +0000 | [diff] [blame] | 1 | //===-- ArchVolatileRegs.cpp ------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Johnny Chen | ff7c3e9 | 2010-12-20 21:45:22 +0000 | [diff] [blame^] | 10 | #include "lldb/lldb-private.h" |
Jason Molenda | ea0dbca | 2010-09-22 07:37:07 +0000 | [diff] [blame] | 11 | #include "lldb/Core/PluginManager.h" |
| 12 | #include "lldb/Core/PluginInterface.h" |
| 13 | #include "lldb/Utility/ArchVolatileRegs.h" |
| 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
| 18 | ArchVolatileRegs* |
| 19 | ArchVolatileRegs::FindPlugin (const ArchSpec &arch) |
| 20 | { |
| 21 | ArchVolatileRegsCreateInstance create_callback; |
| 22 | |
| 23 | for (uint32_t idx = 0; |
| 24 | (create_callback = PluginManager::GetArchVolatileRegsCreateCallbackAtIndex(idx)) != NULL; |
| 25 | ++idx) |
| 26 | { |
| 27 | std::auto_ptr<ArchVolatileRegs> default_volatile_regs_ap (create_callback (arch)); |
| 28 | if (default_volatile_regs_ap.get ()) |
| 29 | return default_volatile_regs_ap.release (); |
| 30 | } |
| 31 | return NULL; |
| 32 | } |
| 33 | |
| 34 | ArchVolatileRegs::ArchVolatileRegs () |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | ArchVolatileRegs::~ArchVolatileRegs () |
| 39 | { |
| 40 | } |