Jim Ingham | 642036f | 2010-09-23 02:01:19 +0000 | [diff] [blame^] | 1 | //===-- LanguageRuntime.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/LanguageRuntime.h" |
| 11 | #include "lldb/Core/PluginManager.h" |
| 12 | |
| 13 | using namespace lldb; |
| 14 | using namespace lldb_private; |
| 15 | |
| 16 | LanguageRuntime* |
| 17 | LanguageRuntime::FindPlugin (Process *process, lldb::LanguageType language) |
| 18 | { |
| 19 | std::auto_ptr<LanguageRuntime> language_runtime_ap; |
| 20 | LanguageRuntimeCreateInstance create_callback; |
| 21 | |
| 22 | for (uint32_t idx = 0; |
| 23 | (create_callback = PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != NULL; |
| 24 | ++idx) |
| 25 | { |
| 26 | language_runtime_ap.reset (create_callback(process, language)); |
| 27 | |
| 28 | if (language_runtime_ap.get()) |
| 29 | return language_runtime_ap.release(); |
| 30 | } |
| 31 | |
| 32 | return NULL; |
| 33 | } |
| 34 | |
| 35 | //---------------------------------------------------------------------- |
| 36 | // Constructor |
| 37 | //---------------------------------------------------------------------- |
| 38 | LanguageRuntime::LanguageRuntime(Process *process) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | //---------------------------------------------------------------------- |
| 43 | // Destructor |
| 44 | //---------------------------------------------------------------------- |
| 45 | LanguageRuntime::~LanguageRuntime() |
| 46 | { |
| 47 | } |