mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 03:50:33 +08:00
This patch is part of ongoing work to extract type
information from the Objective-C runtime. This patch takes the old AppleObjCSymbolVendor and replaces it with an AppleObjCTypeVendor, which is much more lightweight. Specifically, the SymbolVendor needs to pretend that there is a backing symbol file for the Types it vends, whereas a TypeVendor only vends bare ClangASTTypes. These ClangASTTypes only need to exist in an ASTContext. The ClangASTSource now falls back to the runtime's TypeVendor (if one exists) if the debug information doesn't find a complete type for a particular Objective-C interface. The runtime's TypeVendor maintains an ASTContext full of types it knows about, and re-uses the ISA-based type query information used by the ValueObjects. Currently, the runtime's TypeVendor doesn't provide useful answers because we haven't yet implemented a way to iterate across all ISAs contained in the target process's runtime. That's the next step. llvm-svn: 163651
This commit is contained in:
56
lldb/include/lldb/Symbol/TypeVendor.h
Normal file
56
lldb/include/lldb/Symbol/TypeVendor.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//===-- TypeVendor.h --------------------------------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef liblldb_TypeVendor_h_
|
||||
#define liblldb_TypeVendor_h_
|
||||
|
||||
namespace lldb_private {
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// The type vendor class is intended as a generic interface to search
|
||||
// for Clang types that are not necessarily backed by a specific symbol
|
||||
// file.
|
||||
//----------------------------------------------------------------------
|
||||
class TypeVendor
|
||||
{
|
||||
public:
|
||||
//------------------------------------------------------------------
|
||||
// Constructors and Destructors
|
||||
//------------------------------------------------------------------
|
||||
TypeVendor()
|
||||
{
|
||||
}
|
||||
|
||||
virtual
|
||||
~TypeVendor()
|
||||
{
|
||||
}
|
||||
|
||||
virtual uint32_t
|
||||
FindTypes (const ConstString &name,
|
||||
bool append,
|
||||
uint32_t max_matches,
|
||||
std::vector <ClangASTType> &types) = 0;
|
||||
|
||||
protected:
|
||||
//------------------------------------------------------------------
|
||||
// Classes that inherit from TypeVendor can see and modify these
|
||||
//------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
//------------------------------------------------------------------
|
||||
// For TypeVendor only
|
||||
//------------------------------------------------------------------
|
||||
DISALLOW_COPY_AND_ASSIGN (TypeVendor);
|
||||
};
|
||||
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif
|
||||
@@ -83,6 +83,12 @@ public:
|
||||
|
||||
static const char *
|
||||
GetNameForLanguageType (lldb::LanguageType language);
|
||||
|
||||
Process *
|
||||
GetProcess()
|
||||
{
|
||||
return m_process;
|
||||
}
|
||||
|
||||
protected:
|
||||
//------------------------------------------------------------------
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "lldb/lldb-private.h"
|
||||
#include "lldb/Core/PluginInterface.h"
|
||||
#include "lldb/Symbol/Type.h"
|
||||
#include "lldb/Symbol/TypeVendor.h"
|
||||
#include "lldb/Target/LanguageRuntime.h"
|
||||
|
||||
namespace lldb_private {
|
||||
@@ -222,14 +223,17 @@ public:
|
||||
virtual ObjCISA
|
||||
GetISA(ValueObject& valobj) = 0;
|
||||
|
||||
virtual ObjCISA
|
||||
GetISA(const ConstString &name);
|
||||
|
||||
virtual ConstString
|
||||
GetActualTypeName(ObjCISA isa);
|
||||
|
||||
virtual ObjCISA
|
||||
GetParentClass(ObjCISA isa);
|
||||
|
||||
virtual SymbolVendor *
|
||||
GetSymbolVendor()
|
||||
virtual TypeVendor *
|
||||
GetTypeVendor()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user