Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- ABI.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 | |
| 10 | #include "lldb/Target/ABI.h" |
| 11 | #include "lldb/Core/PluginManager.h" |
| 12 | |
| 13 | using namespace lldb; |
| 14 | using namespace lldb_private; |
| 15 | |
Greg Clayton | 75906e4 | 2011-05-11 18:39:18 +0000 | [diff] [blame] | 16 | ABISP |
Greg Clayton | 395fc33 | 2011-02-15 21:59:32 +0000 | [diff] [blame] | 17 | ABI::FindPlugin (const ArchSpec &arch) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 18 | { |
Greg Clayton | 75906e4 | 2011-05-11 18:39:18 +0000 | [diff] [blame] | 19 | ABISP abi_sp; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 20 | ABICreateInstance create_callback; |
| 21 | |
| 22 | for (uint32_t idx = 0; |
| 23 | (create_callback = PluginManager::GetABICreateCallbackAtIndex(idx)) != NULL; |
| 24 | ++idx) |
| 25 | { |
Greg Clayton | 75906e4 | 2011-05-11 18:39:18 +0000 | [diff] [blame] | 26 | abi_sp = create_callback(arch); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 27 | |
Greg Clayton | 75906e4 | 2011-05-11 18:39:18 +0000 | [diff] [blame] | 28 | if (abi_sp) |
| 29 | return abi_sp; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 30 | } |
Greg Clayton | 75906e4 | 2011-05-11 18:39:18 +0000 | [diff] [blame] | 31 | abi_sp.reset(); |
| 32 | return abi_sp; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | //---------------------------------------------------------------------- |
| 36 | // Constructor |
| 37 | //---------------------------------------------------------------------- |
| 38 | ABI::ABI() |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | //---------------------------------------------------------------------- |
| 43 | // Destructor |
| 44 | //---------------------------------------------------------------------- |
| 45 | ABI::~ABI() |
| 46 | { |
| 47 | } |