2010-06-09 00:52:24 +08:00
|
|
|
//===-- ABI.cpp -------------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Target/ABI.h"
|
|
|
|
#include "lldb/Core/PluginManager.h"
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
ABI*
|
2011-02-16 05:59:32 +08:00
|
|
|
ABI::FindPlugin (const ArchSpec &arch)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
|
|
|
std::auto_ptr<ABI> abi_ap;
|
|
|
|
ABICreateInstance create_callback;
|
|
|
|
|
|
|
|
for (uint32_t idx = 0;
|
|
|
|
(create_callback = PluginManager::GetABICreateCallbackAtIndex(idx)) != NULL;
|
|
|
|
++idx)
|
|
|
|
{
|
2011-02-16 05:59:32 +08:00
|
|
|
abi_ap.reset (create_callback(arch));
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
if (abi_ap.get())
|
|
|
|
return abi_ap.release();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Constructor
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
ABI::ABI()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Destructor
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
ABI::~ABI()
|
|
|
|
{
|
|
|
|
}
|