Files
clang-p2996/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
Enrico Granata 5f9d310640 Add a new type of plugin: Language plugin
The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin

The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation

At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++

llvm-svn: 246212
2015-08-27 21:33:50 +00:00

69 lines
1.6 KiB
C++

//===-- ObjCLanguage.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "ObjCLanguage.h"
#include "lldb/Core/ConstString.h"
#include "lldb/Core/PluginManager.h"
using namespace lldb;
using namespace lldb_private;
void
ObjCLanguage::Initialize()
{
PluginManager::RegisterPlugin (GetPluginNameStatic(),
"Objective-C Language",
CreateInstance);
}
void
ObjCLanguage::Terminate()
{
PluginManager::UnregisterPlugin (CreateInstance);
}
lldb_private::ConstString
ObjCLanguage::GetPluginNameStatic()
{
static ConstString g_name("objc");
return g_name;
}
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
lldb_private::ConstString
ObjCLanguage::GetPluginName()
{
return GetPluginNameStatic();
}
uint32_t
ObjCLanguage::GetPluginVersion()
{
return 1;
}
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
Language *
ObjCLanguage::CreateInstance (lldb::LanguageType language)
{
switch (language)
{
case lldb::eLanguageTypeObjC:
return new ObjCLanguage();
default:
return nullptr;
}
}