[Lldb-commits] [lldb] r178113 - Don't use a "uintptr_t" for the metadata key, use a "void *". This removes all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata.
Greg Clayton
gclayton at apple.com
Tue Mar 26 18:48:02 PDT 2013
Author: gclayton
Date: Tue Mar 26 20:48:02 2013
New Revision: 178113
URL: http://llvm.org/viewvc/llvm-project?rev=178113&view=rev
Log:
Don't use a "uintptr_t" for the metadata key, use a "void *". This removes all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata.
Modified:
lldb/trunk/include/lldb/Expression/ClangASTSource.h
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/ClangASTType.h
lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Expression/ClangUserExpression.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/ClangASTImporter.cpp
lldb/trunk/source/Symbol/ClangASTType.cpp
lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp
Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangASTSource.h?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangASTSource.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangASTSource.h Tue Mar 26 20:48:02 2013
@@ -297,17 +297,19 @@ public:
}
ClangASTMetadata *
- GetMetadata(uintptr_t object)
+ GetMetadata(const void * object)
{
return m_original.GetMetadata(object);
}
- void SetMetadata(uintptr_t object, ClangASTMetadata &metadata)
+ void
+ SetMetadata(const void * object, ClangASTMetadata &metadata)
{
return m_original.SetMetadata(object, metadata);
}
- bool HasMetadata(uintptr_t object)
+ bool
+ HasMetadata(const void * object)
{
return m_original.HasMetadata(object);
}
Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Mar 26 20:48:02 2013
@@ -144,10 +144,10 @@ public:
GetCompleteDecl (clang::ASTContext *ast,
clang::Decl *decl);
- void SetMetadataAsUserID (uintptr_t object,
+ void SetMetadataAsUserID (const void *object,
lldb::user_id_t user_id);
- void SetMetadata (uintptr_t object,
+ void SetMetadata (const void *object,
ClangASTMetadata &meta_data)
{
SetMetadata(getASTContext(), object, meta_data);
@@ -155,18 +155,18 @@ public:
static void
SetMetadata (clang::ASTContext *ast,
- uintptr_t object,
+ const void *object,
ClangASTMetadata &meta_data);
ClangASTMetadata *
- GetMetadata (uintptr_t object)
+ GetMetadata (const void *object)
{
return GetMetadata(getASTContext(), object);
}
static ClangASTMetadata *
GetMetadata (clang::ASTContext *ast,
- uintptr_t object);
+ const void *object);
//------------------------------------------------------------------
// Basic Types
Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Tue Mar 26 20:48:02 2013
@@ -214,12 +214,6 @@ public:
lldb::clang_type_t opaque_clang_qual_type,
Stream *s);
- void DumpTypeCode (Stream *s);
-
- static void
- DumpTypeCode (void *type,
- Stream *s);
-
lldb::Encoding
GetEncoding (uint64_t &count);
Modified: lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h Tue Mar 26 20:48:02 2013
@@ -74,7 +74,9 @@ public:
m_union_is_user_id = true;
m_union_is_isa_ptr = false;
}
- lldb::user_id_t GetUserID () const
+
+ lldb::user_id_t
+ GetUserID () const
{
if (m_union_is_user_id)
return m_user_id;
@@ -90,7 +92,8 @@ public:
m_union_is_isa_ptr = true;
}
- uint64_t GetISAPtr () const
+ uint64_t
+ GetISAPtr () const
{
if (m_union_is_isa_ptr)
return m_isa_ptr;
@@ -98,7 +101,8 @@ public:
return 0;
}
- void SetObjectPtrName(const char *name)
+ void
+ SetObjectPtrName(const char *name)
{
m_has_object_ptr = true;
if (strcmp (name, "self") == 0)
@@ -122,7 +126,8 @@ public:
return lldb::eLanguageTypeUnknown;
}
- const char *GetObjectPtrName() const
+ const char *
+ GetObjectPtrName() const
{
if (m_has_object_ptr)
{
@@ -135,11 +140,15 @@ public:
return NULL;
}
- bool HasObjectPtr() const
+ bool
+ HasObjectPtr() const
{
return m_has_object_ptr;
}
+ void
+ Dump (Stream *s);
+
private:
union
{
@@ -160,11 +169,11 @@ public:
ClangExternalASTSourceCommon();
~ClangExternalASTSourceCommon();
- virtual ClangASTMetadata *GetMetadata(uintptr_t object);
- virtual void SetMetadata(uintptr_t object, ClangASTMetadata &metadata);
- virtual bool HasMetadata(uintptr_t object);
+ virtual ClangASTMetadata *GetMetadata(const void *object);
+ virtual void SetMetadata(const void *object, ClangASTMetadata &metadata);
+ virtual bool HasMetadata(const void *object);
private:
- typedef llvm::DenseMap<uintptr_t, ClangASTMetadata> MetadataMap;
+ typedef llvm::DenseMap<const void *, ClangASTMetadata> MetadataMap;
MetadataMap m_metadata;
uint64_t m_magic; ///< Because we don't have RTTI, we must take it
Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Tue Mar 26 20:48:02 2013
@@ -805,8 +805,6 @@ protected:
if (format != eFormatDefault)
valobj_sp->SetFormat (format);
- bool scope_already_checked = true;
-
ValueObject::DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions(false,format));
ValueObject::DumpValueObject (*output_stream,
Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Tue Mar 26 20:48:02 2013
@@ -228,7 +228,7 @@ ClangUserExpression::ScanContext(Executi
// that this is a method of a class in whatever runtime the debug info says the object pointer
// belongs to. Do that here.
- ClangASTMetadata *metadata = ClangASTContext::GetMetadata (&decl_context->getParentASTContext(), (uintptr_t) function_decl);
+ ClangASTMetadata *metadata = ClangASTContext::GetMetadata (&decl_context->getParentASTContext(), function_decl);
if (metadata && metadata->HasObjectPtr())
{
lldb::LanguageType language = metadata->GetObjectPtrLanguage();
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp Tue Mar 26 20:48:02 2013
@@ -198,8 +198,8 @@ AppleObjCTypeVendor::GetDeclForISA(ObjCL
NULL);
ClangASTMetadata meta_data;
- meta_data.SetISAPtr((uint64_t) isa);
- m_external_source->SetMetadata((uintptr_t)new_iface_decl, meta_data);
+ meta_data.SetISAPtr(isa);
+ m_external_source->SetMetadata(new_iface_decl, meta_data);
new_iface_decl->setHasExternalVisibleStorage();
new_iface_decl->setHasExternalLexicalStorage();
@@ -500,7 +500,7 @@ AppleObjCTypeVendor::FinishDecl(clang::O
{
lldb::LogSP log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
- ClangASTMetadata *metadata = m_external_source->GetMetadata((uintptr_t)interface_decl);
+ ClangASTMetadata *metadata = m_external_source->GetMetadata(interface_decl);
ObjCLanguageRuntime::ObjCISA objc_isa = 0;
if (metadata)
objc_isa = metadata->GetISAPtr();
@@ -630,7 +630,7 @@ AppleObjCTypeVendor::FindTypes (const Co
ASTDumper dumper(result_iface_type);
uint64_t isa_value = LLDB_INVALID_ADDRESS;
- ClangASTMetadata *metadata = m_external_source->GetMetadata((uintptr_t)result_iface_decl);
+ ClangASTMetadata *metadata = m_external_source->GetMetadata(result_iface_decl);
if (metadata)
isa_value = metadata->GetISAPtr();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Mar 26 20:48:02 2013
@@ -1848,7 +1848,7 @@ SymbolFileDWARF::ParseChildMembers
accessibility,
bit_size);
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)field_decl, MakeUserID(die->GetOffset()));
+ GetClangASTContext().SetMetadataAsUserID (field_decl, MakeUserID(die->GetOffset()));
if (this_field_info.IsValid())
{
@@ -1893,7 +1893,7 @@ SymbolFileDWARF::ParseChildMembers
&metadata));
if (ivar_decl)
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)ivar_decl, MakeUserID(die->GetOffset()));
+ GetClangASTContext().SetMetadataAsUserID (ivar_decl, MakeUserID(die->GetOffset()));
}
}
}
@@ -4059,7 +4059,7 @@ SymbolFileDWARF::ParseChildParameters (c
assert(param_var_decl);
function_param_decls.push_back(param_var_decl);
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)param_var_decl, MakeUserID(die->GetOffset()));
+ GetClangASTContext().SetMetadataAsUserID (param_var_decl, MakeUserID(die->GetOffset()));
}
}
}
@@ -5920,8 +5920,8 @@ SymbolFileDWARF::ParseType (const Symbol
clang_type = ast.CreateClassTemplateSpecializationType (class_specialization_decl);
clang_type_was_created = true;
- GetClangASTContext().SetMetadata ((uintptr_t)class_template_decl, metadata);
- GetClangASTContext().SetMetadata ((uintptr_t)class_specialization_decl, metadata);
+ GetClangASTContext().SetMetadata (class_template_decl, metadata);
+ GetClangASTContext().SetMetadata (class_specialization_decl, metadata);
}
}
@@ -6338,7 +6338,7 @@ SymbolFileDWARF::ParseType (const Symbol
if (type_handled)
{
LinkDeclContextToDIE(ClangASTContext::GetAsDeclContext(objc_method_decl), die);
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)objc_method_decl, MakeUserID(die->GetOffset()));
+ GetClangASTContext().SetMetadataAsUserID (objc_method_decl, MakeUserID(die->GetOffset()));
}
else
{
@@ -6509,11 +6509,11 @@ SymbolFileDWARF::ParseType (const Symbol
{
metadata.SetObjectPtrName(object_pointer_name.c_str());
if (log)
- log->Printf ("Setting object pointer name: %s on method object 0x%ld.\n",
+ log->Printf ("Setting object pointer name: %s on method object %p.\n",
object_pointer_name.c_str(),
- (uintptr_t) cxx_method_decl);
+ cxx_method_decl);
}
- GetClangASTContext().SetMetadata ((uintptr_t)cxx_method_decl, metadata);
+ GetClangASTContext().SetMetadata (cxx_method_decl, metadata);
}
}
}
@@ -6587,11 +6587,11 @@ SymbolFileDWARF::ParseType (const Symbol
{
metadata.SetObjectPtrName(object_pointer_name.c_str());
if (log)
- log->Printf ("Setting object pointer name: %s on function object 0x%ld.\n",
+ log->Printf ("Setting object pointer name: %s on function object %p.",
object_pointer_name.c_str(),
- (uintptr_t) function_decl);
+ function_decl);
}
- GetClangASTContext().SetMetadata ((uintptr_t)function_decl, metadata);
+ GetClangASTContext().SetMetadata (function_decl, metadata);
}
}
type_sp.reset( new Type (MakeUserID(die->GetOffset()),
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Mar 26 20:48:02 2013
@@ -1168,7 +1168,7 @@ ClangASTContext::CreateRecordType (DeclC
if (decl)
{
if (metadata)
- SetMetadata(ast, (uintptr_t)decl, *metadata);
+ SetMetadata(ast, decl, *metadata);
if (access_type != eAccessNone)
decl->setAccess (ConvertAccessTypeToAccessSpecifier (access_type));
@@ -2312,7 +2312,7 @@ ClangASTContext::CreateObjCClass
isInternal);
if (decl && metadata)
- SetMetadata(ast, (uintptr_t)decl, *metadata);
+ SetMetadata(ast, decl, *metadata);
return ast->getObjCInterfaceType(decl).getAsOpaquePtr();
}
@@ -2474,7 +2474,7 @@ ClangASTContext::AddObjCClassProperty
if (property_decl)
{
if (metadata)
- SetMetadata(ast, (uintptr_t)property_decl, *metadata);
+ SetMetadata(ast, property_decl, *metadata);
class_interface_decl->addDecl (property_decl);
@@ -2554,7 +2554,7 @@ ClangASTContext::AddObjCClassProperty
HasRelatedResultType);
if (getter && metadata)
- SetMetadata(ast, (uintptr_t)getter, *metadata);
+ SetMetadata(ast, getter, *metadata);
getter->setMethodParams(*ast, ArrayRef<ParmVarDecl*>(), ArrayRef<SourceLocation>());
@@ -2589,7 +2589,7 @@ ClangASTContext::AddObjCClassProperty
HasRelatedResultType);
if (setter && metadata)
- SetMetadata(ast, (uintptr_t)setter, *metadata);
+ SetMetadata(ast, setter, *metadata);
llvm::SmallVector<ParmVarDecl *, 1> params;
@@ -5772,7 +5772,7 @@ ClangASTContext::IsPossibleDynamicType (
success = cxx_record_decl->isDynamicClass();
else
{
- ClangASTMetadata *metadata = GetMetadata (ast, (uintptr_t)cxx_record_decl);
+ ClangASTMetadata *metadata = GetMetadata (ast, cxx_record_decl);
if (metadata)
success = metadata->GetIsDynamicCXXType();
else
@@ -6522,7 +6522,7 @@ ClangASTContext::GetCompleteDecl (clang:
}
void
-ClangASTContext::SetMetadataAsUserID (uintptr_t object,
+ClangASTContext::SetMetadataAsUserID (const void *object,
user_id_t user_id)
{
ClangASTMetadata meta_data;
@@ -6532,7 +6532,7 @@ ClangASTContext::SetMetadataAsUserID (ui
void
ClangASTContext::SetMetadata (clang::ASTContext *ast,
- uintptr_t object,
+ const void *object,
ClangASTMetadata &metadata)
{
ClangExternalASTSourceCommon *external_source =
@@ -6544,7 +6544,7 @@ ClangASTContext::SetMetadata (clang::AST
ClangASTMetadata *
ClangASTContext::GetMetadata (clang::ASTContext *ast,
- uintptr_t object)
+ const void *object)
{
ClangExternalASTSourceCommon *external_source =
static_cast<ClangExternalASTSourceCommon*>(ast->getExternalSource());
@@ -6611,7 +6611,7 @@ ClangASTContext::GetClassMethodInfoForDe
}
else if (clang::FunctionDecl *function_decl = llvm::dyn_cast<clang::FunctionDecl>(decl_ctx))
{
- ClangASTMetadata *metadata = GetMetadata (&decl_ctx->getParentASTContext(), (uintptr_t) function_decl);
+ ClangASTMetadata *metadata = GetMetadata (&decl_ctx->getParentASTContext(), function_decl);
if (metadata && metadata->HasObjectPtr())
{
language_object_name.SetCString (metadata->GetObjectPtrName());
Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Tue Mar 26 20:48:02 2013
@@ -337,9 +337,9 @@ ClangASTImporter::GetDeclMetadata (const
DeclOrigin decl_origin = GetDeclOrigin(decl);
if (decl_origin.Valid())
- return ClangASTContext::GetMetadata(decl_origin.ctx, (uintptr_t)decl_origin.decl);
+ return ClangASTContext::GetMetadata(decl_origin.ctx, decl_origin.decl);
else
- return ClangASTContext::GetMetadata(&decl->getASTContext(), (uintptr_t)decl);
+ return ClangASTContext::GetMetadata(&decl->getASTContext(), decl);
}
ClangASTImporter::DeclOrigin
Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Mar 26 20:48:02 2013
@@ -38,6 +38,7 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/ClangExternalASTSourceCommon.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
@@ -1314,6 +1315,11 @@ ClangASTType::DumpTypeDescription ()
{
StreamFile s (stdout, false);
DumpTypeDescription (&s);
+ ClangASTMetadata *metadata = ClangASTContext::GetMetadata (m_ast, m_type);
+ if (metadata)
+ {
+ metadata->Dump (&s);
+ }
}
void
@@ -1339,8 +1345,9 @@ ClangASTType::DumpTypeDescription (clang
{
case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
- if (ClangASTContext::GetCompleteType (ast_context, clang_type))
{
+ ClangASTContext::GetCompleteType (ast_context, clang_type);
+
const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
assert (objc_class_type);
if (objc_class_type)
@@ -1378,8 +1385,9 @@ ClangASTType::DumpTypeDescription (clang
return;
case clang::Type::Record:
- if (ClangASTContext::GetCompleteType (ast_context, clang_type))
{
+ ClangASTContext::GetCompleteType (ast_context, clang_type);
+
const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
const clang::RecordDecl *record_decl = record_type->getDecl();
const clang::CXXRecordDecl *cxx_record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
@@ -1417,20 +1425,6 @@ ClangASTType::DumpTypeDescription (clang
}
}
-void
-ClangASTType::DumpTypeCode (Stream *s)
-{
- DumpTypeCode(m_type, s);
-}
-
-void
-ClangASTType::DumpTypeCode (void *type,
- Stream *s)
-{
- clang::QualType qual_type(clang::QualType::getFromOpaquePtr(type));
- s->PutCString(qual_type.getAsString().c_str());
-}
-
bool
ClangASTType::GetValueAsScalar
(
Modified: lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp?rev=178113&r1=178112&r2=178113&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp (original)
+++ lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp Tue Mar 26 20:48:02 2013
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/ClangExternalASTSourceCommon.h"
+#include "lldb/Core/Stream.h"
using namespace lldb_private;
@@ -28,7 +29,7 @@ ClangExternalASTSourceCommon::~ClangExte
}
ClangASTMetadata *
-ClangExternalASTSourceCommon::GetMetadata (uintptr_t object)
+ClangExternalASTSourceCommon::GetMetadata (const void *object)
{
assert (m_magic == ClangExternalASTSourceCommon_MAGIC);
@@ -39,7 +40,7 @@ ClangExternalASTSourceCommon::GetMetadat
}
void
-ClangExternalASTSourceCommon::SetMetadata (uintptr_t object, ClangASTMetadata &metadata)
+ClangExternalASTSourceCommon::SetMetadata (const void *object, ClangASTMetadata &metadata)
{
assert (m_magic == ClangExternalASTSourceCommon_MAGIC);
@@ -50,9 +51,39 @@ ClangExternalASTSourceCommon::SetMetadat
}
bool
-ClangExternalASTSourceCommon::HasMetadata (uintptr_t object)
+ClangExternalASTSourceCommon::HasMetadata (const void *object)
{
assert (m_magic == ClangExternalASTSourceCommon_MAGIC);
return m_metadata.find(object) != m_metadata.end();
}
+
+void
+ClangASTMetadata::Dump (Stream *s)
+{
+ lldb::user_id_t uid = GetUserID ();
+
+ if (uid != LLDB_INVALID_UID)
+ {
+ s->Printf ("uid=0x%" PRIx64, uid);
+ }
+
+ uint64_t isa_ptr = GetISAPtr ();
+ if (isa_ptr != 0)
+ {
+ s->Printf ("isa_ptr=0x%" PRIx64, isa_ptr);
+ }
+
+ const char *obj_ptr_name = GetObjectPtrName();
+ if (obj_ptr_name)
+ {
+ s->Printf ("obj_ptr_name=\"%s\" ", obj_ptr_name);
+ }
+
+ if (m_is_dynamic_cxx)
+ {
+ s->Printf ("is_dynamic_cxx=%i ", m_is_dynamic_cxx);
+ }
+ s->EOL();
+}
+
More information about the lldb-commits
mailing list