[Lldb-commits] [lldb] r245905 - Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 24 16:46:33 PDT 2015
Author: gclayton
Date: Mon Aug 24 18:46:31 2015
New Revision: 245905
URL: http://llvm.org/viewvc/llvm-project?rev=245905&view=rev
Log:
Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files.
Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types.
Bulk renames for things that used to return a ClangASTType which is now CompilerType:
"Type::GetClangFullType()" to "Type::GetFullCompilerType()"
"Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()"
"Type::GetClangForwardType()" to "Type::GetForwardCompilerType()"
"Value::GetClangType()" to "Value::GetCompilerType()"
"Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)"
"ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()"
many more renames that are similar.
Added:
lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
lldb/trunk/source/Symbol/CompilerDeclContext.cpp
Removed:
lldb/trunk/include/lldb/Symbol/ClangNamespaceDecl.h
lldb/trunk/source/Symbol/ClangNamespaceDecl.cpp
Modified:
lldb/trunk/include/lldb/Core/ClangForward.h
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Core/Value.h
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectCast.h
lldb/trunk/include/lldb/Core/ValueObjectChild.h
lldb/trunk/include/lldb/Core/ValueObjectConstResult.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectMemory.h
lldb/trunk/include/lldb/Core/ValueObjectRegister.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/include/lldb/Core/ValueObjectVariable.h
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
lldb/trunk/include/lldb/Expression/ClangASTSource.h
lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
lldb/trunk/include/lldb/Symbol/Block.h
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
lldb/trunk/include/lldb/Symbol/CompilerType.h
lldb/trunk/include/lldb/Symbol/Function.h
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/SymbolVendor.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/Symbol/TypeSystem.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/API/SBValue.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Commands/CommandObjectArgs.cpp
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Commands/CommandObjectTarget.cpp
lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
lldb/trunk/source/Core/AddressResolverName.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Core/FormatEntity.cpp
lldb/trunk/source/Core/Module.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Core/SourceManager.cpp
lldb/trunk/source/Core/Value.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Core/ValueObjectCast.cpp
lldb/trunk/source/Core/ValueObjectChild.cpp
lldb/trunk/source/Core/ValueObjectConstResult.cpp
lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Core/ValueObjectRegister.cpp
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/source/Core/ValueObjectVariable.cpp
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
lldb/trunk/source/DataFormatters/Cocoa.cpp
lldb/trunk/source/DataFormatters/CoreMedia.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/LibCxx.cpp
lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp
lldb/trunk/source/DataFormatters/LibCxxList.cpp
lldb/trunk/source/DataFormatters/LibCxxMap.cpp
lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp
lldb/trunk/source/DataFormatters/LibCxxVector.cpp
lldb/trunk/source/DataFormatters/LibStdcpp.cpp
lldb/trunk/source/DataFormatters/NSArray.cpp
lldb/trunk/source/DataFormatters/NSIndexPath.cpp
lldb/trunk/source/DataFormatters/NSSet.cpp
lldb/trunk/source/DataFormatters/TypeFormat.cpp
lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
lldb/trunk/source/DataFormatters/VectorType.cpp
lldb/trunk/source/Expression/ClangASTSource.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Expression/ClangExpressionVariable.cpp
lldb/trunk/source/Expression/ClangFunction.cpp
lldb/trunk/source/Expression/ClangUserExpression.cpp
lldb/trunk/source/Expression/Materializer.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
lldb/trunk/source/Symbol/Block.cpp
lldb/trunk/source/Symbol/CMakeLists.txt
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/ClangASTImporter.cpp
lldb/trunk/source/Symbol/CompilerType.cpp
lldb/trunk/source/Symbol/Function.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Symbol/TypeList.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/source/Target/ThreadPlanStepOut.cpp
lldb/trunk/source/Target/ThreadPlanTracer.cpp
Modified: lldb/trunk/include/lldb/Core/ClangForward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ClangForward.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ClangForward.h (original)
+++ lldb/trunk/include/lldb/Core/ClangForward.h Mon Aug 24 18:46:31 2015
@@ -132,6 +132,8 @@ namespace clang
namespace llvm
{
+ class APInt;
+ class APSInt;
class LLVMContext;
class ExecutionEngine;
}
Modified: lldb/trunk/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Module.h (original)
+++ lldb/trunk/include/lldb/Core/Module.h Mon Aug 24 18:46:31 2015
@@ -324,7 +324,7 @@ public:
//------------------------------------------------------------------
size_t
FindFunctions (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
uint32_t name_type_mask,
bool symbols_ok,
bool inlines_ok,
@@ -393,8 +393,8 @@ public:
/// The name of the global or static variable we are looking
/// for.
///
- /// @param[in] namespace_decl
- /// If valid, a namespace to search in.
+ /// @param[in] parent_decl_ctx
+ /// If valid, a decl context that results must exist within
///
/// @param[in] append
/// If \b true, any matches will be appended to \a
@@ -414,7 +414,7 @@ public:
//------------------------------------------------------------------
size_t
FindGlobalVariables (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
VariableList& variable_list);
@@ -525,7 +525,7 @@ public:
size_t
FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
size_t max_matches,
TypeList& type_list);
@@ -1193,7 +1193,7 @@ private:
size_t
FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
TypeList& types);
Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Mon Aug 24 18:46:31 2015
@@ -134,10 +134,10 @@ public:
operator=(const Value &rhs);
const CompilerType &
- GetClangType();
+ GetCompilerType();
void
- SetClangType (const CompilerType &clang_type);
+ SetCompilerType (const CompilerType &clang_type);
ValueType
GetValueType() const;
Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Mon Aug 24 18:46:31 2015
@@ -374,7 +374,7 @@ public:
virtual ~ValueObject();
CompilerType
- GetClangType ();
+ GetCompilerType ();
// this vends a TypeImpl that is useful at the SB API layer
virtual TypeImpl
@@ -1232,7 +1232,7 @@ protected:
//------------------------------------------------------------------
virtual CompilerType
- GetClangTypeImpl () = 0;
+ GetCompilerTypeImpl () = 0;
const char *
GetLocationAsCStringImpl (const Value& value,
Modified: lldb/trunk/include/lldb/Core/ValueObjectCast.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectCast.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectCast.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectCast.h Mon Aug 24 18:46:31 2015
@@ -66,7 +66,7 @@ protected:
UpdateValue () override;
CompilerType
- GetClangTypeImpl () override;
+ GetCompilerTypeImpl () override;
CompilerType m_cast_type;
Modified: lldb/trunk/include/lldb/Core/ValueObjectChild.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectChild.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h Mon Aug 24 18:46:31 2015
@@ -90,7 +90,7 @@ protected:
CanUpdateWithInvalidExecutionContext ();
virtual CompilerType
- GetClangTypeImpl ()
+ GetCompilerTypeImpl ()
{
return m_clang_type;
}
Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResult.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResult.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectConstResult.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResult.h Mon Aug 24 18:46:31 2015
@@ -139,7 +139,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
ConstString m_type_name;
uint64_t m_byte_size;
Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h Mon Aug 24 18:46:31 2015
@@ -39,9 +39,9 @@ public:
int32_t synthetic_index) override;
virtual CompilerType
- GetClangType ()
+ GetCompilerType ()
{
- return ValueObjectCast::GetClangType();
+ return ValueObjectCast::GetCompilerType();
}
lldb::ValueObjectSP
Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h Mon Aug 24 18:46:31 2015
@@ -46,9 +46,9 @@ public:
CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) override;
virtual CompilerType
- GetClangType ()
+ GetCompilerType ()
{
- return ValueObjectChild::GetClangType();
+ return ValueObjectChild::GetCompilerType();
}
lldb::ValueObjectSP
Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Mon Aug 24 18:46:31 2015
@@ -131,7 +131,7 @@ protected:
}
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
Address m_address; ///< The variable that this value object is based upon
TypeAndOrName m_dynamic_type_info; // We can have a type_sp or just a name
Modified: lldb/trunk/include/lldb/Core/ValueObjectMemory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectMemory.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectMemory.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectMemory.h Mon Aug 24 18:46:31 2015
@@ -67,7 +67,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
Address m_address; ///< The variable that this value object is based upon
lldb::TypeSP m_type_sp;
Modified: lldb/trunk/include/lldb/Core/ValueObjectRegister.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectRegister.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectRegister.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectRegister.h Mon Aug 24 18:46:31 2015
@@ -60,7 +60,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
lldb::RegisterContextSP m_reg_ctx_sp;
@@ -114,7 +114,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
lldb::RegisterContextSP m_reg_ctx_sp;
const RegisterSet *m_reg_set;
@@ -171,7 +171,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
lldb::RegisterContextSP m_reg_ctx_sp;
RegisterInfo m_reg_info;
Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Mon Aug 24 18:46:31 2015
@@ -166,7 +166,7 @@ protected:
}
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
virtual void
CreateSynthFilter ();
Modified: lldb/trunk/include/lldb/Core/ValueObjectVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectVariable.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectVariable.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectVariable.h Mon Aug 24 18:46:31 2015
@@ -75,7 +75,7 @@ protected:
UpdateValue ();
virtual CompilerType
- GetClangTypeImpl ();
+ GetCompilerTypeImpl ();
lldb::VariableSP m_variable_sp; ///< The variable that this value object is based upon
Value m_resolved_value; ///< The value that DWARFExpression resolves this variable to before we patch it up
Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Aug 24 18:46:31 2015
@@ -248,7 +248,7 @@ public:
{
FormattersMatchVector matches;
GetPossibleMatches (valobj,
- valobj.GetClangType(),
+ valobj.GetCompilerType(),
lldb_private::eFormatterChoiceCriterionDirectChoice,
use_dynamic,
matches,
Modified: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Mon Aug 24 18:46:31 2015
@@ -268,7 +268,7 @@ public:
uint32_t* why = NULL)
{
uint32_t value = lldb_private::eFormatterChoiceCriterionDirectChoice;
- CompilerType ast_type(valobj.GetClangType());
+ CompilerType ast_type(valobj.GetCompilerType());
bool ret = Get(valobj, ast_type, entry, use_dynamic, value);
if (ret)
entry = MapValueType(entry);
Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangASTSource.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangASTSource.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangASTSource.h Mon Aug 24 18:46:31 2015
@@ -353,7 +353,7 @@ protected:
void
FindExternalVisibleDecls (NameSearchContext &context,
lldb::ModuleSP module,
- ClangNamespaceDecl &namespace_decl,
+ CompilerDeclContext &namespace_decl,
unsigned int current_id);
//------------------------------------------------------------------
Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Mon Aug 24 18:46:31 2015
@@ -19,7 +19,6 @@
// Other libraries and framework includes
// Project includes
-#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "clang/AST/Decl.h"
#include "lldb/lldb-public.h"
@@ -385,7 +384,7 @@ public:
void
FindExternalVisibleDecls (NameSearchContext &context,
lldb::ModuleSP module,
- ClangNamespaceDecl &namespace_decl,
+ CompilerDeclContext &namespace_decl,
unsigned int current_id);
private:
ClangExpressionVariableList m_found_entities; ///< All entities that were looked up for the parser.
@@ -546,7 +545,7 @@ private:
FindGlobalVariable (Target &target,
lldb::ModuleSP &module,
const ConstString &name,
- ClangNamespaceDecl *namespace_decl,
+ CompilerDeclContext *namespace_decl,
TypeFromUser *type = NULL);
//------------------------------------------------------------------
Modified: lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h Mon Aug 24 18:46:31 2015
@@ -222,10 +222,10 @@ public:
SetRegisterInfo (const RegisterInfo *reg_info);
CompilerType
- GetClangType ();
+ GetCompilerType ();
void
- SetClangType (const CompilerType &clang_type);
+ SetCompilerType (const CompilerType &clang_type);
TypeFromUser
GetTypeFromUser ();
@@ -420,7 +420,7 @@ public:
{
lldb::ClangExpressionVariableSP var_sp(new ClangExpressionVariable(exe_scope, byte_order, addr_byte_size));
var_sp->SetName (name);
- var_sp->SetClangType (user_type);
+ var_sp->SetCompilerType (user_type);
m_variables.push_back(var_sp);
return var_sp;
}
Modified: lldb/trunk/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Block.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Block.h (original)
+++ lldb/trunk/include/lldb/Symbol/Block.h Mon Aug 24 18:46:31 2015
@@ -357,8 +357,8 @@ public:
return m_inlineInfoSP.get();
}
- clang::DeclContext *
- GetClangDeclContext();
+ CompilerDeclContext
+ GetDeclContext();
//------------------------------------------------------------------
/// Get the memory cost of this object.
Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Aug 24 18:46:31 2015
@@ -196,10 +196,7 @@ public:
GetDeclContextForType (clang::QualType type);
static clang::DeclContext *
- GetDeclContextForType (const CompilerType& type)
- {
- return GetDeclContextForType(GetQualType(type));
- }
+ GetDeclContextForType (const CompilerType& type);
uint32_t
GetPointerByteSize () override;
@@ -213,12 +210,6 @@ public:
return GetTranslationUnitDecl (getASTContext());
}
- static bool
- GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
- lldb::LanguageType &language,
- bool &is_instance_method,
- ConstString &language_object_name);
-
static CompilerType
CopyType(clang::ASTContext *dest_context,
CompilerType source_type);
@@ -262,7 +253,7 @@ public:
{
clang::NamedDecl *named_decl = result[0];
if (const RecordDeclType *record_decl = llvm::dyn_cast<RecordDeclType>(named_decl))
- clang_type.SetClangType(ast, clang::QualType(record_decl->getTypeForDecl(), 0));
+ clang_type.SetCompilerType(ast, clang::QualType(record_decl->getTypeForDecl(), 0));
}
}
}
@@ -531,6 +522,16 @@ public:
lldb_private::Type *type,
CompilerType &clang_type) override;
+ CompilerDeclContext
+ GetDeclContextForUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *dwarf_cu,
+ const DWARFDebugInfoEntry* die) override;
+
+ CompilerDeclContext
+ GetDeclContextContainingUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *dwarf_cu,
+ const DWARFDebugInfoEntry* die) override;
+
//------------------------------------------------------------------
// ClangASTContext callbacks for external source lookups.
//------------------------------------------------------------------
@@ -549,86 +550,111 @@ public:
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &base_offsets,
llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &vbase_offsets);
- bool
- DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
- SymbolFileDWARF *dwarf,
- DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry *die) override;
-
clang::NamespaceDecl *
ResolveNamespaceDIE (SymbolFileDWARF *dwarf,
DWARFCompileUnit *dwarf_cu,
- const DWARFDebugInfoEntry *die) override;
+ const DWARFDebugInfoEntry *die);
- clang::DeclContext*
- GetClangDeclContextForTypeUID (SymbolFileDWARF *dwarf,
- const lldb_private::SymbolContext &sc,
- lldb::user_id_t type_uid) override;
-
- clang::DeclContext*
- GetClangDeclContextContainingTypeUID (SymbolFileDWARF *dwarf,
- lldb::user_id_t type_uid) override;
+ //----------------------------------------------------------------------
+ // CompilerDeclContext override functions
+ //----------------------------------------------------------------------
+
+ bool
+ DeclContextIsStructUnionOrClass (void *opaque_decl_ctx) override;
+ ConstString
+ DeclContextGetName (void *opaque_decl_ctx) override;
+
+ bool
+ DeclContextIsClassMethod (void *opaque_decl_ctx,
+ lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr) override;
+
+ //----------------------------------------------------------------------
+ // Clang specific clang::DeclContext functions
+ //----------------------------------------------------------------------
+
+ static clang::DeclContext *
+ DeclContextGetAsDeclContext (const CompilerDeclContext &dc);
+
+ static clang::ObjCMethodDecl *
+ DeclContextGetAsObjCMethodDecl (const CompilerDeclContext &dc);
+
+ static clang::CXXMethodDecl *
+ DeclContextGetAsCXXMethodDecl (const CompilerDeclContext &dc);
+
+ static clang::FunctionDecl *
+ DeclContextGetAsFunctionDecl (const CompilerDeclContext &dc);
+
+ static clang::NamespaceDecl *
+ DeclContextGetAsNamespaceDecl (const CompilerDeclContext &dc);
+
+ static ClangASTMetadata *
+ DeclContextGetMetaData (const CompilerDeclContext &dc, const void *object);
+
+ static clang::ASTContext *
+ DeclContextGetClangASTContext (const CompilerDeclContext &dc);
//----------------------------------------------------------------------
// Tests
//----------------------------------------------------------------------
bool
- IsArrayType (void* type,
+ IsArrayType (void *type,
CompilerType *element_type,
uint64_t *size,
bool *is_incomplete) override;
bool
- IsVectorType (void* type,
+ IsVectorType (void *type,
CompilerType *element_type,
uint64_t *size) override;
bool
- IsAggregateType (void* type) override;
+ IsAggregateType (void *type) override;
bool
- IsBeingDefined (void* type) override;
+ IsBeingDefined (void *type) override;
bool
- IsCharType (void* type) override;
+ IsCharType (void *type) override;
bool
- IsCompleteType (void* type) override;
+ IsCompleteType (void *type) override;
bool
- IsConst(void* type) override;
+ IsConst(void *type) override;
bool
- IsCStringType (void* type, uint32_t &length) override;
+ IsCStringType (void *type, uint32_t &length) override;
static bool
IsCXXClassType (const CompilerType& type);
bool
- IsDefined(void* type) override;
+ IsDefined(void *type) override;
bool
- IsFloatingPointType (void* type, uint32_t &count, bool &is_complex) override;
+ IsFloatingPointType (void *type, uint32_t &count, bool &is_complex) override;
bool
- IsFunctionType (void* type, bool *is_variadic_ptr) override;
-
+ IsFunctionType (void *type, bool *is_variadic_ptr) override;
+
uint32_t
- IsHomogeneousAggregate (void* type, CompilerType* base_type_ptr) override;
+ IsHomogeneousAggregate (void *type, CompilerType* base_type_ptr) override;
size_t
- GetNumberOfFunctionArguments (void* type) override;
+ GetNumberOfFunctionArguments (void *type) override;
CompilerType
- GetFunctionArgumentAtIndex (void* type, const size_t index) override;
+ GetFunctionArgumentAtIndex (void *type, const size_t index) override;
bool
- IsFunctionPointerType (void* type) override;
+ IsFunctionPointerType (void *type) override;
bool
- IsIntegerType (void* type, bool &is_signed) override;
+ IsIntegerType (void *type, bool &is_signed) override;
static bool
IsObjCClassType (const CompilerType& type);
@@ -643,34 +669,34 @@ public:
IsObjCObjectPointerType (const CompilerType& type, CompilerType *target_type = NULL);
bool
- IsPolymorphicClass (void* type) override;
+ IsPolymorphicClass (void *type) override;
bool
- IsPossibleDynamicType (void* type,
+ IsPossibleDynamicType (void *type,
CompilerType *target_type, // Can pass NULL
bool check_cplusplus,
bool check_objc) override;
bool
- IsRuntimeGeneratedType (void* type) override;
+ IsRuntimeGeneratedType (void *type) override;
bool
- IsPointerType (void* type, CompilerType *pointee_type) override;
+ IsPointerType (void *type, CompilerType *pointee_type) override;
bool
- IsPointerOrReferenceType (void* type, CompilerType *pointee_type) override;
+ IsPointerOrReferenceType (void *type, CompilerType *pointee_type) override;
bool
- IsReferenceType (void* type, CompilerType *pointee_type, bool* is_rvalue) override;
+ IsReferenceType (void *type, CompilerType *pointee_type, bool* is_rvalue) override;
bool
- IsScalarType (void* type) override;
+ IsScalarType (void *type) override;
bool
- IsTypedefType (void* type) override;
+ IsTypedefType (void *type) override;
bool
- IsVoidType (void* type) override;
+ IsVoidType (void *type) override;
static bool
GetCXXClassName (const CompilerType& type, std::string &class_name);
@@ -684,26 +710,26 @@ public:
//----------------------------------------------------------------------
bool
- GetCompleteType (void* type) override;
+ GetCompleteType (void *type) override;
//----------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------
ConstString
- GetTypeName (void* type) override;
+ GetTypeName (void *type) override;
uint32_t
- GetTypeInfo (void* type, CompilerType *pointee_or_element_clang_type) override;
+ GetTypeInfo (void *type, CompilerType *pointee_or_element_clang_type) override;
lldb::LanguageType
- GetMinimumLanguage (void* type) override;
+ GetMinimumLanguage (void *type) override;
lldb::TypeClass
- GetTypeClass (void* type) override;
+ GetTypeClass (void *type) override;
unsigned
- GetTypeQualifiers(void* type) override;
+ GetTypeQualifiers(void *type) override;
//----------------------------------------------------------------------
// Creating related types
@@ -723,52 +749,52 @@ public:
static CompilerType
CreateTypedefType (const CompilerType& type,
const char *typedef_name,
- clang::DeclContext *decl_ctx);
+ const CompilerDeclContext &compiler_decl_ctx);
CompilerType
- GetArrayElementType (void* type, uint64_t *stride) override;
+ GetArrayElementType (void *type, uint64_t *stride) override;
CompilerType
- GetCanonicalType (void* type) override;
+ GetCanonicalType (void *type) override;
CompilerType
- GetFullyUnqualifiedType (void* type) override;
+ GetFullyUnqualifiedType (void *type) override;
// Returns -1 if this isn't a function of if the function doesn't have a prototype
// Returns a value >= 0 if there is a prototype.
int
- GetFunctionArgumentCount (void* type) override;
+ GetFunctionArgumentCount (void *type) override;
CompilerType
- GetFunctionArgumentTypeAtIndex (void* type, size_t idx) override;
+ GetFunctionArgumentTypeAtIndex (void *type, size_t idx) override;
CompilerType
- GetFunctionReturnType (void* type) override;
+ GetFunctionReturnType (void *type) override;
size_t
- GetNumMemberFunctions (void* type) override;
+ GetNumMemberFunctions (void *type) override;
TypeMemberFunctionImpl
- GetMemberFunctionAtIndex (void* type, size_t idx) override;
+ GetMemberFunctionAtIndex (void *type, size_t idx) override;
static CompilerType
GetLValueReferenceType (const CompilerType& type);
CompilerType
- GetNonReferenceType (void* type) override;
+ GetNonReferenceType (void *type) override;
CompilerType
- GetPointeeType (void* type) override;
+ GetPointeeType (void *type) override;
CompilerType
- GetPointerType (void* type) override;
+ GetPointerType (void *type) override;
static CompilerType
GetRValueReferenceType (const CompilerType& type);
// If the current object represents a typedef type, get the underlying type
CompilerType
- GetTypedefedType (void* type) override;
+ GetTypedefedType (void *type) override;
static CompilerType
RemoveFastQualifiers (const CompilerType& type);
@@ -777,7 +803,7 @@ public:
// Create related types using the current type's AST
//----------------------------------------------------------------------
CompilerType
- GetBasicTypeFromAST (void* type, lldb::BasicType basic_type) override;
+ GetBasicTypeFromAST (lldb::BasicType basic_type) override;
//----------------------------------------------------------------------
// Exploring the type
@@ -790,58 +816,61 @@ public:
}
uint64_t
- GetBitSize (void* type, ExecutionContextScope *exe_scope) override;
+ GetBitSize (void *type, ExecutionContextScope *exe_scope) override;
lldb::Encoding
- GetEncoding (void* type, uint64_t &count) override;
+ GetEncoding (void *type, uint64_t &count) override;
lldb::Format
- GetFormat (void* type) override;
+ GetFormat (void *type) override;
size_t
- GetTypeBitAlign (void* type) override;
+ GetTypeBitAlign (void *type) override;
uint32_t
- GetNumChildren (void* type, bool omit_empty_base_classes) override;
+ GetNumChildren (void *type, bool omit_empty_base_classes) override;
lldb::BasicType
- GetBasicTypeEnumeration (void* type) override;
+ GetBasicTypeEnumeration (void *type) override;
static lldb::BasicType
- GetBasicTypeEnumeration (void* type, const ConstString &name);
-
- static uint32_t
- GetNumDirectBaseClasses (const CompilerType& type);
-
- static uint32_t
- GetNumVirtualBaseClasses (const CompilerType& type);
-
+ GetBasicTypeEnumeration (void *type, const ConstString &name);
+
+ void
+ ForEachEnumerator (void *type, std::function <bool (const CompilerType &integer_type, const ConstString &name, const llvm::APSInt &value)> const &callback) override;
+
uint32_t
- GetNumFields (void* type) override;
-
- static CompilerType
- GetDirectBaseClassAtIndex (const CompilerType& type,
- size_t idx,
- uint32_t *bit_offset_ptr);
-
- static CompilerType
- GetVirtualBaseClassAtIndex (const CompilerType& type,
- size_t idx,
- uint32_t *bit_offset_ptr);
+ GetNumFields (void *type) override;
CompilerType
- GetFieldAtIndex (void* type,
+ GetFieldAtIndex (void *type,
size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
bool *is_bitfield_ptr) override;
-
+
+ uint32_t
+ GetNumDirectBaseClasses (void *type) override;
+
+ uint32_t
+ GetNumVirtualBaseClasses (void *type) override;
+
+ CompilerType
+ GetDirectBaseClassAtIndex (void *type,
+ size_t idx,
+ uint32_t *bit_offset_ptr) override;
+
+ CompilerType
+ GetVirtualBaseClassAtIndex (void *type,
+ size_t idx,
+ uint32_t *bit_offset_ptr) override;
+
static uint32_t
GetNumPointeeChildren (clang::QualType type);
CompilerType
- GetChildClangTypeAtIndex (void* type,
+ GetChildClangTypeAtIndex (void *type,
ExecutionContext *exe_ctx,
size_t idx,
bool transparent_pointers,
@@ -859,7 +888,7 @@ public:
// Lookup a child given a name. This function will match base class names
// and member member names in "clang_type" only, not descendants.
uint32_t
- GetIndexOfChildWithName (void* type,
+ GetIndexOfChildWithName (void *type,
const char *name,
bool omit_empty_base_classes) override;
@@ -869,16 +898,16 @@ public:
// TODO: Return all matches for a given name by returning a vector<vector<uint32_t>>
// so we catch all names that match a given child name, not just the first.
size_t
- GetIndexOfChildMemberWithName (void* type,
+ GetIndexOfChildMemberWithName (void *type,
const char *name,
bool omit_empty_base_classes,
std::vector<uint32_t>& child_indexes) override;
size_t
- GetNumTemplateArguments (void* type) override;
+ GetNumTemplateArguments (void *type) override;
CompilerType
- GetTemplateArgument (void* type,
+ GetTemplateArgument (void *type,
size_t idx,
lldb::TemplateArgumentKind &kind) override;
@@ -906,7 +935,7 @@ public:
lldb::AccessType access);
clang::CXXMethodDecl *
- AddMethodToCXXRecordType (void* type,
+ AddMethodToCXXRecordType (void *type,
const char *name,
const CompilerType &method_type,
lldb::AccessType access,
@@ -919,7 +948,7 @@ public:
// C++ Base Classes
clang::CXXBaseSpecifier *
- CreateBaseClassSpecifier (void* type,
+ CreateBaseClassSpecifier (void *type,
lldb::AccessType access,
bool is_virtual,
bool base_of_class);
@@ -929,7 +958,7 @@ public:
unsigned num_base_classes);
bool
- SetBaseClassesForClassType (void* type,
+ SetBaseClassesForClassType (void *type,
clang::CXXBaseSpecifier const * const *base_classes,
unsigned num_base_classes);
@@ -950,13 +979,13 @@ public:
static clang::ObjCMethodDecl *
AddMethodToObjCObjectType (const CompilerType& type,
- const char *name, // the full symbol name as seen in the symbol table (void* type, "-[NString stringWithCString:]")
+ const char *name, // the full symbol name as seen in the symbol table (void *type, "-[NString stringWithCString:]")
const CompilerType &method_clang_type,
lldb::AccessType access,
bool is_artificial);
bool
- SetHasExternalStorage (void* type, bool has_extern);
+ SetHasExternalStorage (void *type, bool has_extern);
//------------------------------------------------------------------
@@ -972,7 +1001,7 @@ public:
// Modifying Enumeration types
//----------------------------------------------------------------------
bool
- AddEnumerationValueToEnumerationType (void* type,
+ AddEnumerationValueToEnumerationType (void *type,
const CompilerType &enumerator_qual_type,
const Declaration &decl,
const char *name,
@@ -982,7 +1011,7 @@ public:
CompilerType
- GetEnumerationIntegerType (void* type);
+ GetEnumerationIntegerType (void *type);
//------------------------------------------------------------------
@@ -998,7 +1027,7 @@ public:
// Converts "s" to a floating point value and place resulting floating
// point bytes in the "dst" buffer.
size_t
- ConvertStringToFloatValue (void* type,
+ ConvertStringToFloatValue (void *type,
const char *s,
uint8_t *dst,
size_t dst_size) override;
@@ -1006,7 +1035,7 @@ public:
// Dumping types
//----------------------------------------------------------------------
void
- DumpValue (void* type,
+ DumpValue (void *type,
ExecutionContext *exe_ctx,
Stream *s,
lldb::Format format,
@@ -1021,7 +1050,7 @@ public:
uint32_t depth) override;
bool
- DumpTypeValue (void* type,
+ DumpTypeValue (void *type,
Stream *s,
lldb::Format format,
const DataExtractor &data,
@@ -1032,7 +1061,7 @@ public:
ExecutionContextScope *exe_scope) override;
void
- DumpSummary (void* type,
+ DumpSummary (void *type,
ExecutionContext *exe_ctx,
Stream *s,
const DataExtractor &data,
@@ -1040,10 +1069,10 @@ public:
size_t data_byte_size) override;
virtual void
- DumpTypeDescription (void* type) override; // Dump to stdout
+ DumpTypeDescription (void *type) override; // Dump to stdout
void
- DumpTypeDescription (void* type, Stream *s) override;
+ DumpTypeDescription (void *type, Stream *s) override;
static clang::EnumDecl *
GetAsEnumDecl (const CompilerType& type);
@@ -1053,7 +1082,7 @@ public:
GetAsRecordDecl (const CompilerType& type);
clang::CXXRecordDecl *
- GetAsCXXRecordDecl (void* type);
+ GetAsCXXRecordDecl (void *type);
static clang::ObjCInterfaceDecl *
GetAsObjCInterfaceDecl (const CompilerType& type);
@@ -1184,25 +1213,15 @@ protected:
clang::DeclContext *
GetClangDeclContextForDIE (SymbolFileDWARF *dwarf,
- const lldb_private::SymbolContext &sc,
DWARFCompileUnit *cu,
const DWARFDebugInfoEntry *die);
clang::DeclContext *
- GetClangDeclContextForDIEOffset (SymbolFileDWARF *dwarf,
- const lldb_private::SymbolContext &sc,
- dw_offset_t die_offset);
-
- clang::DeclContext *
GetClangDeclContextContainingDIE (SymbolFileDWARF *dwarf,
DWARFCompileUnit *cu,
const DWARFDebugInfoEntry *die,
const DWARFDebugInfoEntry **decl_ctx_die);
- clang::DeclContext *
- GetClangDeclContextContainingDIEOffset (SymbolFileDWARF *dwarf,
- dw_offset_t die_offset);
-
bool
CopyUniqueClassMethodTypes (SymbolFileDWARF *dwarf,
SymbolFileDWARF *src_symfile,
Modified: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Mon Aug 24 18:46:31 2015
@@ -17,7 +17,7 @@
#include "clang/AST/ASTImporter.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
+#include "lldb/Symbol/CompilerDeclContext.h"
namespace lldb_private {
@@ -155,7 +155,7 @@ public:
// Namespace maps
//
- typedef std::vector < std::pair<lldb::ModuleSP, ClangNamespaceDecl> > NamespaceMap;
+ typedef std::vector < std::pair<lldb::ModuleSP, CompilerDeclContext> > NamespaceMap;
typedef std::shared_ptr<NamespaceMap> NamespaceMapSP;
void RegisterNamespaceMap (const clang::NamespaceDecl *decl,
Removed: lldb/trunk/include/lldb/Symbol/ClangNamespaceDecl.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangNamespaceDecl.h?rev=245904&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangNamespaceDecl.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangNamespaceDecl.h (removed)
@@ -1,105 +0,0 @@
-//===-- ClangNamespaceDecl.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_ClangNamespaceDecl_h_
-#define liblldb_ClangNamespaceDecl_h_
-
-#include <string>
-
-#include "lldb/lldb-public.h"
-#include "lldb/Core/ClangForward.h"
-
-namespace lldb_private {
-
-class ClangNamespaceDecl
-{
-public:
- ClangNamespaceDecl () :
- m_ast (NULL),
- m_namespace_decl (NULL)
- {
- }
-
- ClangNamespaceDecl (clang::ASTContext *ast, clang::NamespaceDecl *namespace_decl) :
- m_ast (ast),
- m_namespace_decl (namespace_decl)
- {
- }
-
- ClangNamespaceDecl (const ClangNamespaceDecl &rhs) :
- m_ast (rhs.m_ast),
- m_namespace_decl (rhs.m_namespace_decl)
- {
- }
-
- const ClangNamespaceDecl &
- operator = (const ClangNamespaceDecl &rhs)
- {
- m_ast = rhs.m_ast;
- m_namespace_decl = rhs.m_namespace_decl;
- return *this;
- }
-
- //------------------------------------------------------------------
- /// Convert to bool operator.
- ///
- /// This allows code to check a ClangNamespaceDecl object to see if
- /// it contains a valid namespace decl using code such as:
- ///
- /// @code
- /// ClangNamespaceDecl ns_decl(...);
- /// if (ns_decl)
- /// { ...
- /// @endcode
- ///
- /// @return
- /// /b True this object contains a valid namespace decl, \b
- /// false otherwise.
- //------------------------------------------------------------------
- explicit operator bool() const
- {
- return m_ast != NULL && m_namespace_decl != NULL;
- }
-
- clang::ASTContext *
- GetASTContext() const
- {
- return m_ast;
- }
-
- void
- SetASTContext (clang::ASTContext *ast)
- {
- m_ast = ast;
- }
-
- clang::NamespaceDecl *
- GetNamespaceDecl () const
- {
- return m_namespace_decl;
- }
-
- void
- SetNamespaceDecl (clang::NamespaceDecl *namespace_decl)
- {
- m_namespace_decl = namespace_decl;
- }
-
- std::string
- GetQualifiedName () const;
-
-protected:
- clang::ASTContext *m_ast;
- clang::NamespaceDecl *m_namespace_decl;
-};
-
-
-} // namespace lldb_private
-
-#endif // #ifndef liblldb_ClangNamespaceDecl_h_
Added: lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h?rev=245905&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h (added)
+++ lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h Mon Aug 24 18:46:31 2015
@@ -0,0 +1,141 @@
+//===-- CompilerDeclContext.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_CompilerDeclContext_h_
+#define liblldb_CompilerDeclContext_h_
+
+#include "lldb/lldb-private.h"
+#include "lldb/Core/ConstString.h"
+
+namespace lldb_private {
+
+class CompilerDeclContext
+{
+public:
+ //----------------------------------------------------------------------
+ // Constructors and Destructors
+ //----------------------------------------------------------------------
+ CompilerDeclContext () :
+ m_type_system (nullptr),
+ m_opaque_decl_ctx (nullptr)
+ {
+ }
+
+ CompilerDeclContext (TypeSystem *type_system, void *decl_ctx) :
+ m_type_system (type_system),
+ m_opaque_decl_ctx (decl_ctx)
+ {
+ }
+
+ ~CompilerDeclContext()
+ {
+ }
+
+ //----------------------------------------------------------------------
+ // Tests
+ //----------------------------------------------------------------------
+
+ explicit operator bool () const
+ {
+ return IsValid ();
+ }
+
+ bool
+ operator < (const CompilerDeclContext &rhs) const
+ {
+ if (m_type_system == rhs.m_type_system)
+ return m_type_system < rhs.m_type_system;
+ return m_type_system < rhs.m_type_system;
+ }
+
+ bool
+ IsValid () const
+ {
+ return m_type_system != nullptr && m_opaque_decl_ctx != nullptr;
+ }
+
+ bool
+ IsClang () const;
+
+ //----------------------------------------------------------------------
+ /// Checks if this decl context represents a method of a class.
+ ///
+ /// @param[out] language_ptr
+ /// If non NULL and \b true is returned from this function,
+ /// this will indicate if the language that respresents the method.
+ ///
+ /// @param[out] is_instance_method_ptr
+ /// If non NULL and \b true is returned from this function,
+ /// this will indicate if the method is an instance function (true)
+ /// or a class method (false indicating the function is static, or
+ /// doesn't require an instance of the class to be called).
+ ///
+ /// @param[out] language_object_name_ptr
+ /// If non NULL and \b true is returned from this function,
+ /// this will indicate if implicit object name for the language
+ /// like "this" for C++, and "self" for Objective C.
+ ///
+ /// @return
+ /// Returns true if this is a decl context that represents a method
+ /// in a struct, union or class.
+ //----------------------------------------------------------------------
+ bool
+ IsClassMethod (lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr);
+
+ //----------------------------------------------------------------------
+ // Accessors
+ //----------------------------------------------------------------------
+
+ TypeSystem *
+ GetTypeSystem() const
+ {
+ return m_type_system;
+ }
+
+ void *
+ GetOpaqueDeclContext() const
+ {
+ return m_opaque_decl_ctx;
+ }
+
+ void
+ SetDeclContext (TypeSystem* type_system, void* decl_ctx)
+ {
+ m_type_system = type_system;
+ m_opaque_decl_ctx = decl_ctx;
+ }
+
+ void
+ Clear()
+ {
+ m_type_system = nullptr;
+ m_opaque_decl_ctx = nullptr;
+ }
+
+ ConstString
+ GetName () const;
+
+ bool
+ IsStructUnionOrClass () const;
+
+private:
+ TypeSystem *m_type_system;
+ void *m_opaque_decl_ctx;
+
+};
+
+bool operator == (const CompilerDeclContext &lhs, const CompilerDeclContext &rhs);
+bool operator != (const CompilerDeclContext &lhs, const CompilerDeclContext &rhs);
+
+
+} // namespace lldb_private
+
+#endif // #ifndef liblldb_CompilerDeclContext_h_
Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon Aug 24 18:46:31 2015
@@ -12,7 +12,7 @@
#include <string>
#include <vector>
-
+#include <functional>
#include "lldb/lldb-private.h"
#include "lldb/Core/ClangForward.h"
@@ -235,9 +235,9 @@ public:
GetTypeClass () const;
void
- SetClangType (TypeSystem* type_system, void* type);
+ SetCompilerType (TypeSystem* type_system, void* type);
void
- SetClangType (clang::ASTContext *ast, clang::QualType qual_type);
+ SetCompilerType (clang::ASTContext *ast, clang::QualType qual_type);
unsigned
GetTypeQualifiers() const;
@@ -284,9 +284,6 @@ public:
// If the current object represents a typedef type, get the underlying type
CompilerType
GetTypedefedType () const;
-
- CompilerType
- RemoveFastQualifiers () const;
//----------------------------------------------------------------------
// Create related types using the current type's AST
@@ -321,7 +318,16 @@ public:
static lldb::BasicType
GetBasicTypeEnumeration (const ConstString &name);
-
+
+ //----------------------------------------------------------------------
+ // If this type is an enumeration, iterate through all of its enumerators
+ // using a callback. If the callback returns true, keep iterating, else
+ // abort the iteration.
+ //----------------------------------------------------------------------
+ void
+ ForEachEnumerator (std::function <bool (const CompilerType &integer_type,
+ const ConstString &name,
+ const llvm::APSInt &value)> const &callback) const;
uint32_t
GetNumFields () const;
@@ -331,7 +337,21 @@ public:
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
bool *is_bitfield_ptr) const;
-
+
+ uint32_t
+ GetNumDirectBaseClasses () const;
+
+ uint32_t
+ GetNumVirtualBaseClasses () const;
+
+ CompilerType
+ GetDirectBaseClassAtIndex (size_t idx,
+ uint32_t *bit_offset_ptr) const;
+
+ CompilerType
+ GetVirtualBaseClassAtIndex (size_t idx,
+ uint32_t *bit_offset_ptr) const;
+
uint32_t
GetIndexOfFieldWithName (const char* name,
CompilerType* field_clang_type = NULL,
Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Mon Aug 24 18:46:31 2015
@@ -550,8 +550,8 @@ public:
/// @return
/// The DeclContext, or NULL if none exists.
//------------------------------------------------------------------
- clang::DeclContext *
- GetClangDeclContext();
+ CompilerDeclContext
+ GetDeclContext();
//------------------------------------------------------------------
/// Get accessor for the type that describes the function
@@ -574,7 +574,7 @@ public:
GetType() const;
CompilerType
- GetClangType ();
+ GetCompilerType ();
uint32_t
GetPrologueByteSize ();
Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Mon Aug 24 18:46:31 2015
@@ -13,7 +13,8 @@
#include "lldb/lldb-private.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Symbol/CompilerType.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
+#include "lldb/Symbol/CompilerDeclContext.h"
+
#include "lldb/Symbol/Type.h"
namespace lldb_private {
@@ -130,15 +131,15 @@ public:
virtual size_t ParseVariablesForContext (const SymbolContext& sc) = 0;
virtual Type* ResolveTypeUID (lldb::user_id_t type_uid) = 0;
virtual bool CompleteType (CompilerType &clang_type) = 0;
- virtual clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) { return NULL; }
- virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) { return NULL; }
+ virtual CompilerDeclContext GetDeclContextForUID (lldb::user_id_t uid) { return CompilerDeclContext(); }
+ virtual CompilerDeclContext GetDeclContextContainingUID (lldb::user_id_t uid) { return CompilerDeclContext(); }
virtual uint32_t ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc) = 0;
- virtual uint32_t ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) = 0;
- virtual uint32_t FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) = 0;
- virtual uint32_t FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables) = 0;
- virtual uint32_t FindFunctions (const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list) = 0;
- virtual uint32_t FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list) = 0;
- virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types) = 0;
+ virtual uint32_t ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list);
+ virtual uint32_t FindGlobalVariables (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, VariableList& variables);
+ virtual uint32_t FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables);
+ virtual uint32_t FindFunctions (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list);
+ virtual uint32_t FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list);
+ virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeList& types);
// virtual uint32_t FindTypes (const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, TypeList& types) = 0;
virtual TypeList * GetTypeList ();
virtual size_t GetTypes (lldb_private::SymbolContextScope *sc_scope,
@@ -150,10 +151,13 @@ public:
virtual lldb_private::TypeSystem *
GetTypeSystemForLanguage (lldb::LanguageType language);
- virtual ClangNamespaceDecl
+ virtual CompilerDeclContext
FindNamespace (const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *parent_namespace_decl) = 0;
+ const CompilerDeclContext *parent_decl_ctx)
+ {
+ return CompilerDeclContext();
+ }
ObjectFile* GetObjectFile() { return m_obj_file; }
const ObjectFile* GetObjectFile() const { return m_obj_file; }
Modified: lldb/trunk/include/lldb/Symbol/SymbolVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolVendor.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolVendor.h Mon Aug 24 18:46:31 2015
@@ -15,7 +15,6 @@
#include "lldb/lldb-private.h"
#include "lldb/Core/ModuleChild.h"
#include "lldb/Core/PluginInterface.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/TypeList.h"
@@ -97,7 +96,7 @@ public:
virtual size_t
FindGlobalVariables (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
VariableList& variables);
@@ -110,7 +109,7 @@ public:
virtual size_t
FindFunctions (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
uint32_t name_type_mask,
bool include_inlines,
bool append,
@@ -125,15 +124,15 @@ public:
virtual size_t
FindTypes (const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
TypeList& types);
- virtual ClangNamespaceDecl
+ virtual CompilerDeclContext
FindNamespace (const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *parent_namespace_decl);
+ const CompilerDeclContext *parent_decl_ctx);
virtual size_t
GetNumCompileUnits();
Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Mon Aug 24 18:46:31 2015
@@ -241,18 +241,18 @@ public:
// Get the clang type, and resolve definitions for any
// class/struct/union/enum types completely.
CompilerType
- GetClangFullType ();
+ GetFullCompilerType ();
// Get the clang type, and resolve definitions enough so that the type could
// have layout performed. This allows ptrs and refs to class/struct/union/enum
// types remain forward declarations.
CompilerType
- GetClangLayoutType ();
+ GetLayoutCompilerType ();
// Get the clang type and leave class/struct/union/enum types as forward
// declarations if they haven't already been fully defined.
CompilerType
- GetClangForwardType ();
+ GetForwardCompilerType ();
ClangASTContext &
GetClangASTContext ();
@@ -276,12 +276,6 @@ public:
uint32_t
GetEncodingMask ();
- CompilerType
- CreateClangTypedefType (Type *typedef_type, Type *base_type);
-
- bool
- IsRealObjCClass();
-
bool
IsCompleteObjCClass()
{
@@ -340,10 +334,10 @@ public:
}
TypePair (lldb::TypeSP type) :
- clang_type(),
- type_sp(type)
+ clang_type(),
+ type_sp(type)
{
- clang_type = type_sp->GetClangForwardType();
+ clang_type = type_sp->GetForwardCompilerType ();
}
bool
@@ -392,7 +386,7 @@ public:
GetDisplayTypeName () const
{
if (type_sp)
- return type_sp->GetClangForwardType().GetDisplayTypeName();
+ return type_sp->GetForwardCompilerType ().GetDisplayTypeName();
if (clang_type)
return clang_type.GetDisplayTypeName();
return ConstString();
@@ -409,7 +403,7 @@ public:
SetType (lldb::TypeSP type)
{
type_sp = type;
- clang_type = type_sp->GetClangForwardType();
+ clang_type = type_sp->GetForwardCompilerType ();
}
lldb::TypeSP
@@ -428,7 +422,7 @@ public:
GetPointerType () const
{
if (type_sp)
- return type_sp->GetClangLayoutType().GetPointerType();
+ return type_sp->GetLayoutCompilerType ().GetPointerType();
return clang_type.GetPointerType();
}
@@ -436,7 +430,7 @@ public:
GetPointeeType () const
{
if (type_sp)
- return type_sp->GetClangFullType().GetPointeeType();
+ return type_sp->GetFullCompilerType ().GetPointeeType();
return clang_type.GetPointeeType();
}
@@ -444,7 +438,7 @@ public:
GetReferenceType () const
{
if (type_sp)
- return ClangASTContext::GetLValueReferenceType(type_sp->GetClangLayoutType());
+ return ClangASTContext::GetLValueReferenceType(type_sp->GetLayoutCompilerType ());
return ClangASTContext::GetLValueReferenceType(clang_type);
}
@@ -452,7 +446,7 @@ public:
GetTypedefedType () const
{
if (type_sp)
- return type_sp->GetClangFullType().GetTypedefedType();
+ return type_sp->GetFullCompilerType ().GetTypedefedType();
return clang_type.GetTypedefedType();
}
@@ -460,7 +454,7 @@ public:
GetDereferencedType () const
{
if (type_sp)
- return type_sp->GetClangFullType().GetNonReferenceType();
+ return type_sp->GetFullCompilerType ().GetNonReferenceType();
return clang_type.GetNonReferenceType();
}
@@ -468,7 +462,7 @@ public:
GetUnqualifiedType () const
{
if (type_sp)
- return type_sp->GetClangLayoutType().GetFullyUnqualifiedType();
+ return type_sp->GetLayoutCompilerType ().GetFullyUnqualifiedType();
return clang_type.GetFullyUnqualifiedType();
}
@@ -476,7 +470,7 @@ public:
GetCanonicalType () const
{
if (type_sp)
- return type_sp->GetClangFullType().GetCanonicalType();
+ return type_sp->GetFullCompilerType ().GetCanonicalType();
return clang_type.GetCanonicalType();
}
@@ -910,8 +904,9 @@ public:
{
}
- TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
- const lldb_private::CompilerType& integer_type);
+ TypeEnumMemberImpl (const lldb::TypeImplSP &integer_type_sp,
+ const ConstString &name,
+ const llvm::APSInt &value);
TypeEnumMemberImpl (const TypeEnumMemberImpl& rhs) :
m_integer_type_sp(rhs.m_integer_type_sp),
Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Mon Aug 24 18:46:31 2015
@@ -10,9 +10,11 @@
#ifndef liblldb_TypeSystem_h_
#define liblldb_TypeSystem_h_
+#include <functional>
#include <string>
#include "lldb/lldb-private.h"
#include "lldb/Core/ClangForward.h"
+#include "lldb/Symbol/CompilerDeclContext.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Type.h"
@@ -65,6 +67,22 @@ public:
return false;
}
+ virtual CompilerDeclContext
+ GetDeclContextForUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *dwarf_cu,
+ const DWARFDebugInfoEntry* die)
+ {
+ return CompilerDeclContext();
+ }
+
+ virtual CompilerDeclContext
+ GetDeclContextContainingUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *dwarf_cu,
+ const DWARFDebugInfoEntry* die)
+ {
+ return CompilerDeclContext();
+ }
+
virtual SymbolFile *
GetSymbolFile () const
{
@@ -78,98 +96,83 @@ public:
m_sym_file = sym_file;
}
- virtual bool
- DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
- SymbolFileDWARF *dwarf,
- DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry *die)
- {
- return false;
- }
+ //----------------------------------------------------------------------
+ // CompilerDeclContext functions
+ //----------------------------------------------------------------------
- virtual clang::NamespaceDecl *
- ResolveNamespaceDIE (SymbolFileDWARF *dwarf,
- DWARFCompileUnit *dwarf_cu,
- const DWARFDebugInfoEntry *die)
- {
- return nullptr;
- }
+ virtual bool
+ DeclContextIsStructUnionOrClass (void *opaque_decl_ctx) = 0;
- virtual clang::DeclContext*
- GetClangDeclContextForTypeUID (SymbolFileDWARF *dwarf,
- const lldb_private::SymbolContext &sc,
- lldb::user_id_t type_uid)
- {
- return nullptr;
- }
+ virtual ConstString
+ DeclContextGetName (void *opaque_decl_ctx) = 0;
- virtual clang::DeclContext*
- GetClangDeclContextContainingTypeUID (SymbolFileDWARF *dwarf, lldb::user_id_t type_uid)
- {
- return nullptr;
- }
+ virtual bool
+ DeclContextIsClassMethod (void *opaque_decl_ctx,
+ lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr) = 0;
//----------------------------------------------------------------------
// Tests
//----------------------------------------------------------------------
virtual bool
- IsArrayType (void * type,
+ IsArrayType (void *type,
CompilerType *element_type,
uint64_t *size,
bool *is_incomplete) = 0;
virtual bool
- IsAggregateType (void * type) = 0;
+ IsAggregateType (void *type) = 0;
virtual bool
- IsCharType (void * type) = 0;
+ IsCharType (void *type) = 0;
virtual bool
- IsCompleteType (void * type) = 0;
+ IsCompleteType (void *type) = 0;
virtual bool
- IsDefined(void * type) = 0;
+ IsDefined(void *type) = 0;
virtual bool
- IsFloatingPointType (void * type, uint32_t &count, bool &is_complex) = 0;
+ IsFloatingPointType (void *type, uint32_t &count, bool &is_complex) = 0;
virtual bool
- IsFunctionType (void * type, bool *is_variadic_ptr) = 0;
-
+ IsFunctionType (void *type, bool *is_variadic_ptr) = 0;
+
virtual size_t
- GetNumberOfFunctionArguments (void * type) = 0;
+ GetNumberOfFunctionArguments (void *type) = 0;
virtual CompilerType
- GetFunctionArgumentAtIndex (void * type, const size_t index) = 0;
+ GetFunctionArgumentAtIndex (void *type, const size_t index) = 0;
virtual bool
- IsFunctionPointerType (void * type) = 0;
+ IsFunctionPointerType (void *type) = 0;
virtual bool
- IsIntegerType (void * type, bool &is_signed) = 0;
+ IsIntegerType (void *type, bool &is_signed) = 0;
virtual bool
- IsPossibleDynamicType (void * type,
+ IsPossibleDynamicType (void *type,
CompilerType *target_type, // Can pass NULL
bool check_cplusplus,
bool check_objc) = 0;
virtual bool
- IsPointerType (void * type, CompilerType *pointee_type) = 0;
+ IsPointerType (void *type, CompilerType *pointee_type) = 0;
virtual bool
- IsScalarType (void * type) = 0;
+ IsScalarType (void *type) = 0;
virtual bool
- IsVoidType (void * type) = 0;
+ IsVoidType (void *type) = 0;
//----------------------------------------------------------------------
// Type Completion
//----------------------------------------------------------------------
virtual bool
- GetCompleteType (void * type) = 0;
+ GetCompleteType (void *type) = 0;
//----------------------------------------------------------------------
// AST related queries
@@ -183,82 +186,103 @@ public:
//----------------------------------------------------------------------
virtual ConstString
- GetTypeName (void * type) = 0;
+ GetTypeName (void *type) = 0;
virtual uint32_t
- GetTypeInfo (void * type, CompilerType *pointee_or_element_clang_type) = 0;
+ GetTypeInfo (void *type, CompilerType *pointee_or_element_clang_type) = 0;
virtual lldb::LanguageType
- GetMinimumLanguage (void * type) = 0;
+ GetMinimumLanguage (void *type) = 0;
virtual lldb::TypeClass
- GetTypeClass (void * type) = 0;
+ GetTypeClass (void *type) = 0;
//----------------------------------------------------------------------
// Creating related types
//----------------------------------------------------------------------
virtual CompilerType
- GetArrayElementType (void * type, uint64_t *stride) = 0;
+ GetArrayElementType (void *type, uint64_t *stride) = 0;
virtual CompilerType
- GetCanonicalType (void * type) = 0;
+ GetCanonicalType (void *type) = 0;
// Returns -1 if this isn't a function of if the function doesn't have a prototype
// Returns a value >= 0 if there is a prototype.
virtual int
- GetFunctionArgumentCount (void * type) = 0;
+ GetFunctionArgumentCount (void *type) = 0;
virtual CompilerType
- GetFunctionArgumentTypeAtIndex (void * type, size_t idx) = 0;
+ GetFunctionArgumentTypeAtIndex (void *type, size_t idx) = 0;
virtual CompilerType
- GetFunctionReturnType (void * type) = 0;
+ GetFunctionReturnType (void *type) = 0;
virtual size_t
- GetNumMemberFunctions (void * type) = 0;
+ GetNumMemberFunctions (void *type) = 0;
virtual TypeMemberFunctionImpl
- GetMemberFunctionAtIndex (void * type, size_t idx) = 0;
+ GetMemberFunctionAtIndex (void *type, size_t idx) = 0;
virtual CompilerType
- GetPointeeType (void * type) = 0;
+ GetPointeeType (void *type) = 0;
virtual CompilerType
- GetPointerType (void * type) = 0;
+ GetPointerType (void *type) = 0;
//----------------------------------------------------------------------
// Exploring the type
//----------------------------------------------------------------------
virtual uint64_t
- GetBitSize (void * type, ExecutionContextScope *exe_scope) = 0;
+ GetBitSize (void *type, ExecutionContextScope *exe_scope) = 0;
virtual lldb::Encoding
- GetEncoding (void * type, uint64_t &count) = 0;
+ GetEncoding (void *type, uint64_t &count) = 0;
virtual lldb::Format
- GetFormat (void * type) = 0;
+ GetFormat (void *type) = 0;
virtual uint32_t
- GetNumChildren (void * type, bool omit_empty_base_classes) = 0;
+ GetNumChildren (void *type, bool omit_empty_base_classes) = 0;
virtual lldb::BasicType
- GetBasicTypeEnumeration (void * type) = 0;
-
+ GetBasicTypeEnumeration (void *type) = 0;
+
+ virtual void
+ ForEachEnumerator (void *type, std::function <bool (const CompilerType &integer_type, const ConstString &name, const llvm::APSInt &value)> const &callback)
+ {
+ }
+
virtual uint32_t
- GetNumFields (void * type) = 0;
+ GetNumFields (void *type) = 0;
virtual CompilerType
- GetFieldAtIndex (void * type,
+ GetFieldAtIndex (void *type,
size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
bool *is_bitfield_ptr) = 0;
-
+
+ virtual uint32_t
+ GetNumDirectBaseClasses (void *type) = 0;
+
+ virtual uint32_t
+ GetNumVirtualBaseClasses (void *type) = 0;
+
+ virtual CompilerType
+ GetDirectBaseClassAtIndex (void *type,
+ size_t idx,
+ uint32_t *bit_offset_ptr) = 0;
+
+ virtual CompilerType
+ GetVirtualBaseClassAtIndex (void *type,
+ size_t idx,
+ uint32_t *bit_offset_ptr) = 0;
+
virtual CompilerType
- GetChildClangTypeAtIndex (void * type,
+ GetChildClangTypeAtIndex (void *type,
ExecutionContext *exe_ctx,
size_t idx,
bool transparent_pointers,
@@ -276,7 +300,7 @@ public:
// Lookup a child given a name. This function will match base class names
// and member member names in "clang_type" only, not descendants.
virtual uint32_t
- GetIndexOfChildWithName (void * type,
+ GetIndexOfChildWithName (void *type,
const char *name,
bool omit_empty_base_classes) = 0;
@@ -286,16 +310,16 @@ public:
// TODO: Return all matches for a given name by returning a vector<vector<uint32_t>>
// so we catch all names that match a given child name, not just the first.
virtual size_t
- GetIndexOfChildMemberWithName (void * type,
+ GetIndexOfChildMemberWithName (void *type,
const char *name,
bool omit_empty_base_classes,
std::vector<uint32_t>& child_indexes) = 0;
virtual size_t
- GetNumTemplateArguments (void * type) = 0;
+ GetNumTemplateArguments (void *type) = 0;
virtual CompilerType
- GetTemplateArgument (void * type,
+ GetTemplateArgument (void *type,
size_t idx,
lldb::TemplateArgumentKind &kind) = 0;
@@ -303,7 +327,7 @@ public:
// Dumping types
//----------------------------------------------------------------------
virtual void
- DumpValue (void * type,
+ DumpValue (void *type,
ExecutionContext *exe_ctx,
Stream *s,
lldb::Format format,
@@ -318,7 +342,7 @@ public:
uint32_t depth) = 0;
virtual bool
- DumpTypeValue (void * type,
+ DumpTypeValue (void *type,
Stream *s,
lldb::Format format,
const DataExtractor &data,
@@ -329,20 +353,20 @@ public:
ExecutionContextScope *exe_scope) = 0;
virtual void
- DumpTypeDescription (void * type) = 0; // Dump to stdout
+ DumpTypeDescription (void *type) = 0; // Dump to stdout
virtual void
- DumpTypeDescription (void * type, Stream *s) = 0;
+ DumpTypeDescription (void *type, Stream *s) = 0;
//----------------------------------------------------------------------
// TODO: These methods appear unused. Should they be removed?
//----------------------------------------------------------------------
virtual bool
- IsRuntimeGeneratedType (void * type) = 0;
+ IsRuntimeGeneratedType (void *type) = 0;
virtual void
- DumpSummary (void * type,
+ DumpSummary (void *type,
ExecutionContext *exe_ctx,
Stream *s,
const DataExtractor &data,
@@ -352,7 +376,7 @@ public:
// Converts "s" to a floating point value and place resulting floating
// point bytes in the "dst" buffer.
virtual size_t
- ConvertStringToFloatValue (void * type,
+ ConvertStringToFloatValue (void *type,
const char *s,
uint8_t *dst,
size_t dst_size) = 0;
@@ -362,52 +386,52 @@ public:
//----------------------------------------------------------------------
virtual bool
- IsPointerOrReferenceType (void * type, CompilerType *pointee_type) = 0;
+ IsPointerOrReferenceType (void *type, CompilerType *pointee_type) = 0;
virtual unsigned
- GetTypeQualifiers(void * type) = 0;
+ GetTypeQualifiers(void *type) = 0;
virtual bool
- IsCStringType (void * type, uint32_t &length) = 0;
+ IsCStringType (void *type, uint32_t &length) = 0;
virtual size_t
- GetTypeBitAlign (void * type) = 0;
+ GetTypeBitAlign (void *type) = 0;
virtual CompilerType
- GetBasicTypeFromAST (void * type, lldb::BasicType basic_type) = 0;
+ GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;
virtual bool
- IsBeingDefined (void * type) = 0;
+ IsBeingDefined (void *type) = 0;
virtual bool
- IsConst(void * type) = 0;
+ IsConst(void *type) = 0;
virtual uint32_t
- IsHomogeneousAggregate (void * type, CompilerType* base_type_ptr) = 0;
+ IsHomogeneousAggregate (void *type, CompilerType* base_type_ptr) = 0;
virtual bool
- IsPolymorphicClass (void * type) = 0;
+ IsPolymorphicClass (void *type) = 0;
virtual bool
- IsTypedefType (void * type) = 0;
+ IsTypedefType (void *type) = 0;
// If the current object represents a typedef type, get the underlying type
virtual CompilerType
- GetTypedefedType (void * type) = 0;
+ GetTypedefedType (void *type) = 0;
virtual bool
- IsVectorType (void * type,
+ IsVectorType (void *type,
CompilerType *element_type,
uint64_t *size) = 0;
virtual CompilerType
- GetFullyUnqualifiedType (void * type) = 0;
+ GetFullyUnqualifiedType (void *type) = 0;
virtual CompilerType
- GetNonReferenceType (void * type) = 0;
+ GetNonReferenceType (void *type) = 0;
virtual bool
- IsReferenceType (void * type, CompilerType *pointee_type, bool* is_rvalue) = 0;
+ IsReferenceType (void *type, CompilerType *pointee_type, bool* is_rvalue) = 0;
protected:
SymbolFile *m_sym_file;
Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Mon Aug 24 18:46:31 2015
@@ -48,7 +48,6 @@ class ClangASTContext;
class ClangASTImporter;
class ClangASTMetadata;
class ClangASTSource;
-class ClangNamespaceDecl;
class ClangExpression;
class ClangExpressionDeclMap;
class ClangExpressionParser;
@@ -67,6 +66,7 @@ class CommandObject;
class CommandReturnObject;
class Communication;
class CompactUnwindInfo;
+class CompilerDeclContext;
class CompilerType;
class CompileUnit;
class Condition;
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Aug 24 18:46:31 2015
@@ -169,6 +169,7 @@
2656BBC41AE073A800441749 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
2656BBC51AE073AD00441749 /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
2656BBC61AE073B500441749 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
+ 2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */; settings = {ASSET_TAGS = (); }; };
2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; settings = {COMPILER_FLAGS = "-Dregister="; }; };
26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; };
266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */; };
@@ -474,7 +475,6 @@
268900D113353E6F00698AC0 /* ClangASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */; };
268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */; };
268900D313353E6F00698AC0 /* ClangExternalASTSourceCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */; };
- 268900D413353E6F00698AC0 /* ClangNamespaceDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266A42D5128E3FFB0090CF7C /* ClangNamespaceDecl.cpp */; };
268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */; };
268900D613353E6F00698AC0 /* Declaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */; };
268900D713353E6F00698AC0 /* DWARFCallFrameInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1710F1B8EC00F91463 /* DWARFCallFrameInfo.cpp */; };
@@ -1447,6 +1447,8 @@
265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_x86_64.cpp; sourceTree = "<group>"; };
265205A713D3E3F700132FE2 /* RegisterContextKDP_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_x86_64.h; sourceTree = "<group>"; };
26579F68126A25920007C5CB /* darwin-debug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwin-debug"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2657AFB51B8690EC00958979 /* CompilerDeclContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompilerDeclContext.h; path = include/lldb/Symbol/CompilerDeclContext.h; sourceTree = "<group>"; };
+ 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerDeclContext.cpp; path = source/Symbol/CompilerDeclContext.cpp; sourceTree = "<group>"; };
265ABF6210F42EE900531910 /* DebugSymbols.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DebugSymbols.framework; path = /System/Library/PrivateFrameworks/DebugSymbols.framework; sourceTree = "<absolute>"; };
265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = debugserver.xcodeproj; path = tools/debugserver/debugserver.xcodeproj; sourceTree = "<group>"; };
2660D9F611922A1300958FBD /* StringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractor.cpp; path = source/Utility/StringExtractor.cpp; sourceTree = "<group>"; };
@@ -1627,8 +1629,6 @@
266960601199F4230075C61A /* build-swig-Python.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-Python.sh"; sourceTree = "<group>"; };
266960611199F4230075C61A /* edit-swig-python-wrapper-file.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "edit-swig-python-wrapper-file.py"; sourceTree = "<group>"; };
266960631199F4230075C61A /* sed-sources */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "sed-sources"; sourceTree = "<group>"; };
- 266A42D5128E3FFB0090CF7C /* ClangNamespaceDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangNamespaceDecl.cpp; path = source/Symbol/ClangNamespaceDecl.cpp; sourceTree = "<group>"; };
- 266A42D7128E40040090CF7C /* ClangNamespaceDecl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangNamespaceDecl.h; path = include/lldb/Symbol/ClangNamespaceDecl.h; sourceTree = "<group>"; };
266DFE9613FD656E00D0C574 /* OperatingSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystem.cpp; path = source/Target/OperatingSystem.cpp; sourceTree = "<group>"; };
266DFE9813FD658300D0C574 /* OperatingSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OperatingSystem.h; path = include/lldb/Target/OperatingSystem.h; sourceTree = "<group>"; };
266F5CBB12FC846200DFCE33 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/Config.h; sourceTree = "<group>"; };
@@ -4146,14 +4146,14 @@
26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */,
49D8FB3713B5594900411094 /* ClangASTImporter.h */,
49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */,
+ 2657AFB51B8690EC00958979 /* CompilerDeclContext.h */,
+ 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */,
49E45FA911F660DC008F7B28 /* CompilerType.h */,
49E45FAD11F660FE008F7B28 /* CompilerType.cpp */,
495B38431489714C002708C5 /* ClangExternalASTSourceCommon.h */,
4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */,
26E6902E129C6BD500DDECD9 /* ClangExternalASTSourceCallbacks.h */,
26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */,
- 266A42D7128E40040090CF7C /* ClangNamespaceDecl.h */,
- 266A42D5128E3FFB0090CF7C /* ClangNamespaceDecl.cpp */,
964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */,
964463EB1A330C0500154ED8 /* CompactUnwindInfo.cpp */,
26BC7C5710F1B6E900F91463 /* CompileUnit.h */,
@@ -6264,7 +6264,6 @@
2613F6C81B17B82F00D4DB85 /* CxaDemangle.cpp in Sources */,
268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */,
268900D313353E6F00698AC0 /* ClangExternalASTSourceCallbacks.cpp in Sources */,
- 268900D413353E6F00698AC0 /* ClangNamespaceDecl.cpp in Sources */,
268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */,
268900D613353E6F00698AC0 /* Declaration.cpp in Sources */,
268900D713353E6F00698AC0 /* DWARFCallFrameInfo.cpp in Sources */,
@@ -6463,6 +6462,7 @@
26EFC4CD18CFAF0D00865D87 /* ObjectFileJIT.cpp in Sources */,
49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */,
494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */,
+ 2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources */,
49DA65031485C92A005FF180 /* AppleObjCDeclVendor.cpp in Sources */,
4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */,
26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */,
Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Mon Aug 24 18:46:31 2015
@@ -14,10 +14,10 @@
#include "lldb/Core/ConstString.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Stream.h"
-#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/Type.h"
+#include "llvm/ADT/APSInt.h"
#include "clang/AST/Decl.h"
using namespace lldb;
@@ -343,12 +343,7 @@ SBType
SBType::GetBasicType(lldb::BasicType basic_type)
{
if (IsValid() && m_opaque_sp->IsValid())
- {
- ClangASTContext* ast = m_opaque_sp->GetTypeSystem(false)->AsClangASTContext();
- if (ast)
- return SBType (ClangASTContext::GetBasicType (ast->getASTContext(), basic_type));
- }
-
+ return SBType(m_opaque_sp->GetTypeSystem(false)->GetBasicTypeFromAST(basic_type));
return SBType();
}
@@ -356,7 +351,7 @@ uint32_t
SBType::GetNumberOfDirectBaseClasses ()
{
if (IsValid())
- return ClangASTContext::GetNumDirectBaseClasses(m_opaque_sp->GetCompilerType(true));
+ return m_opaque_sp->GetCompilerType(true).GetNumDirectBaseClasses();
return 0;
}
@@ -364,7 +359,7 @@ uint32_t
SBType::GetNumberOfVirtualBaseClasses ()
{
if (IsValid())
- return ClangASTContext::GetNumVirtualBaseClasses(m_opaque_sp->GetCompilerType(true));
+ return m_opaque_sp->GetCompilerType(true).GetNumVirtualBaseClasses();
return 0;
}
@@ -399,16 +394,10 @@ SBType::GetDirectBaseClassAtIndex (uint3
SBTypeMember sb_type_member;
if (IsValid())
{
- CompilerType this_type (m_opaque_sp->GetCompilerType (true));
- if (this_type.IsValid())
- {
- uint32_t bit_offset = 0;
- CompilerType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(this_type, idx, &bit_offset));
- if (base_class_type.IsValid())
- {
- sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
- }
- }
+ uint32_t bit_offset = 0;
+ CompilerType base_class_type = m_opaque_sp->GetCompilerType (true).GetDirectBaseClassAtIndex(idx, &bit_offset);
+ if (base_class_type.IsValid())
+ sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
}
return sb_type_member;
@@ -420,16 +409,10 @@ SBType::GetVirtualBaseClassAtIndex (uint
SBTypeMember sb_type_member;
if (IsValid())
{
- CompilerType this_type (m_opaque_sp->GetCompilerType (true));
- if (this_type.IsValid())
- {
- uint32_t bit_offset = 0;
- CompilerType base_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(this_type, idx, &bit_offset));
- if (base_class_type.IsValid())
- {
- sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
- }
- }
+ uint32_t bit_offset = 0;
+ CompilerType base_class_type = m_opaque_sp->GetCompilerType (true).GetVirtualBaseClassAtIndex(idx, &bit_offset);
+ if (base_class_type.IsValid())
+ sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
}
return sb_type_member;
}
@@ -440,16 +423,14 @@ SBType::GetEnumMembers ()
SBTypeEnumMemberList sb_enum_member_list;
if (IsValid())
{
- const clang::EnumDecl *enum_decl = ClangASTContext::GetAsEnumDecl(m_opaque_sp->GetCompilerType(true).GetFullyUnqualifiedType());
- if (enum_decl)
+ CompilerType this_type (m_opaque_sp->GetCompilerType (true));
+ if (this_type.IsValid())
{
- clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
- for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
- {
- SBTypeEnumMember enum_member;
- enum_member.reset(new TypeEnumMemberImpl(*enum_pos, CompilerType(m_opaque_sp->GetTypeSystem(true), enum_decl->getIntegerType().getAsOpaquePtr())));
+ this_type.ForEachEnumerator([&sb_enum_member_list] (const CompilerType &integer_type, const ConstString &name, const llvm::APSInt &value) -> bool {
+ SBTypeEnumMember enum_member (lldb::TypeEnumMemberImplSP (new TypeEnumMemberImpl(lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
sb_enum_member_list.Append(enum_member);
- }
+ return true; // Keep iterating
+ });
}
}
return sb_enum_member_list;
Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Mon Aug 24 18:46:31 2015
@@ -1319,7 +1319,7 @@ SBValue::GetOpaqueType()
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
- return value_sp->GetClangType().GetOpaqueQualType();
+ return value_sp->GetCompilerType().GetOpaqueQualType();
return NULL;
}
@@ -1812,7 +1812,7 @@ SBValue::Watch (bool resolve_location, b
watch_type |= LLDB_WATCH_TYPE_WRITE;
Error rc;
- CompilerType type (value_sp->GetClangType());
+ CompilerType type (value_sp->GetCompilerType());
WatchpointSP watchpoint_sp = target_sp->CreateWatchpoint(addr, byte_size, &type, watch_type, rc);
error.SetError(rc);
Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Mon Aug 24 18:46:31 2015
@@ -17,7 +17,6 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/StreamString.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Mon Aug 24 18:46:31 2015
@@ -234,7 +234,7 @@ CommandObjectArgs::DoExecute (Args& args
return false;
}
- value.SetClangType (clang_type);
+ value.SetCompilerType (clang_type);
value_list.PushValue(value);
}
Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Mon Aug 24 18:46:31 2015
@@ -533,7 +533,7 @@ protected:
clang::TypeDecl *tdecl = target->GetPersistentVariables().GetPersistentType(ConstString(lookup_type_name));
if (tdecl)
{
- clang_ast_type.SetClangType(ClangASTContext::GetASTContext(&tdecl->getASTContext()),(const lldb::clang_type_t)tdecl->getTypeForDecl());
+ clang_ast_type.SetCompilerType(ClangASTContext::GetASTContext(&tdecl->getASTContext()),(const lldb::clang_type_t)tdecl->getTypeForDecl());
}
}
@@ -550,7 +550,7 @@ protected:
else
{
TypeSP type_sp (type_list.GetTypeAtIndex(0));
- clang_ast_type = type_sp->GetClangFullType();
+ clang_ast_type = type_sp->GetFullCompilerType ();
}
}
@@ -1124,7 +1124,7 @@ protected:
result_sp.get())
{
uint64_t value = result_sp->GetValueAsUnsigned(0);
- switch (result_sp->GetClangType().GetByteSize(nullptr))
+ switch (result_sp->GetCompilerType().GetByteSize(nullptr))
{
case 1: {
uint8_t byte = (uint8_t)value;
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Aug 24 18:46:31 2015
@@ -1871,7 +1871,7 @@ LookupTypeInModule (CommandInterpreter &
{
// Resolve the clang type so that any forward references
// to types that haven't yet been parsed will get parsed.
- type_sp->GetClangFullType ();
+ type_sp->GetFullCompilerType ();
type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
// Print all typedef chains
TypeSP typedef_type_sp (type_sp);
@@ -1880,7 +1880,7 @@ LookupTypeInModule (CommandInterpreter &
{
strm.EOL();
strm.Printf(" typedef '%s': ", typedef_type_sp->GetName().GetCString());
- typedefed_type_sp->GetClangFullType ();
+ typedefed_type_sp->GetFullCompilerType ();
typedefed_type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
typedef_type_sp = typedefed_type_sp;
typedefed_type_sp = typedef_type_sp->GetTypedefType();
@@ -1924,7 +1924,7 @@ LookupTypeHere (CommandInterpreter &inte
{
// Resolve the clang type so that any forward references
// to types that haven't yet been parsed will get parsed.
- type_sp->GetClangFullType ();
+ type_sp->GetFullCompilerType ();
type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
// Print all typedef chains
TypeSP typedef_type_sp (type_sp);
@@ -1933,7 +1933,7 @@ LookupTypeHere (CommandInterpreter &inte
{
strm.EOL();
strm.Printf(" typedef '%s': ", typedef_type_sp->GetName().GetCString());
- typedefed_type_sp->GetClangFullType ();
+ typedefed_type_sp->GetFullCompilerType ();
typedefed_type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
typedef_type_sp = typedefed_type_sp;
typedefed_type_sp = typedef_type_sp->GetTypedefType();
Modified: lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp Mon Aug 24 18:46:31 2015
@@ -1061,7 +1061,7 @@ protected:
size = m_option_watchpoint.watch_size == 0 ? valobj_sp->GetByteSize()
: m_option_watchpoint.watch_size;
}
- clang_type = valobj_sp->GetClangType();
+ clang_type = valobj_sp->GetCompilerType();
}
else
{
@@ -1295,7 +1295,7 @@ protected:
// Fetch the type from the value object, the type of the watched object is the pointee type
/// of the expression, so convert to that if we found a valid type.
- CompilerType clang_type(valobj_sp->GetClangType());
+ CompilerType clang_type(valobj_sp->GetCompilerType());
Error error;
Watchpoint *wp = target->CreateWatchpoint(addr, size, &clang_type, watch_type, error).get();
Modified: lldb/trunk/source/Core/AddressResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/AddressResolverName.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/AddressResolverName.cpp (original)
+++ lldb/trunk/source/Core/AddressResolverName.cpp Mon Aug 24 18:46:31 2015
@@ -13,7 +13,6 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/StreamString.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/Symbol.h"
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Mon Aug 24 18:46:31 2015
@@ -28,7 +28,6 @@
#include "lldb/Interpreter/OptionValueDictionary.h"
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/OptionValueUInt64.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ExecutionContext.h"
Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Mon Aug 24 18:46:31 2015
@@ -885,10 +885,10 @@ DumpValue (Stream &s,
}
// TODO use flags for these
- const uint32_t type_info_flags = target->GetClangType().GetTypeInfo(NULL);
+ const uint32_t type_info_flags = target->GetCompilerType().GetTypeInfo(NULL);
bool is_array = (type_info_flags & eTypeIsArray) != 0;
bool is_pointer = (type_info_flags & eTypeIsPointer) != 0;
- bool is_aggregate = target->GetClangType().IsAggregateType();
+ bool is_aggregate = target->GetCompilerType().IsAggregateType();
if ((is_array || is_pointer) && (!is_array_range) && val_obj_display == ValueObject::eValueObjectRepresentationStyleValue) // this should be wrong, but there are some exceptions
{
@@ -1788,7 +1788,7 @@ FormatEntity::Format (const Entry &entry
ValueObjectSP var_value_sp (ValueObjectVariable::Create (exe_scope, var_sp));
const char *var_representation = nullptr;
const char *var_name = var_value_sp->GetName().GetCString();
- if (var_value_sp->GetClangType().IsAggregateType() &&
+ if (var_value_sp->GetCompilerType().IsAggregateType() &&
DataVisualization::ShouldPrintAsOneLiner(*var_value_sp.get()))
{
static StringSummaryFormat format(TypeSummaryImpl::Flags()
Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Mon Aug 24 18:46:31 2015
@@ -723,14 +723,14 @@ Module::ResolveSymbolContextsForFileSpec
size_t
Module::FindGlobalVariables (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
- return symbols->FindGlobalVariables(name, namespace_decl, append, max_matches, variables);
+ return symbols->FindGlobalVariables(name, parent_decl_ctx, append, max_matches, variables);
return 0;
}
@@ -773,7 +773,7 @@ Module::FindCompileUnits (const FileSpec
size_t
Module::FindFunctions (const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
uint32_t name_type_mask,
bool include_symbols,
bool include_inlines,
@@ -803,7 +803,7 @@ Module::FindFunctions (const ConstString
if (symbols)
{
symbols->FindFunctions(lookup_name,
- namespace_decl,
+ parent_decl_ctx,
lookup_name_type_mask,
include_inlines,
append,
@@ -843,7 +843,7 @@ Module::FindFunctions (const ConstString
{
if (symbols)
{
- symbols->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, append, sc_list);
+ symbols->FindFunctions(name, parent_decl_ctx, name_type_mask, include_inlines, append, sc_list);
// Now check our symbol table for symbols that are code symbols if requested
if (include_symbols)
@@ -961,7 +961,7 @@ Module::FindAddressesForLine (const lldb
size_t
Module::FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
TypeList& types)
@@ -971,7 +971,7 @@ Module::FindTypes_Impl (const SymbolCont
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
- return symbols->FindTypes(sc, name, namespace_decl, append, max_matches, types);
+ return symbols->FindTypes(sc, name, parent_decl_ctx, append, max_matches, types);
}
return 0;
}
@@ -979,12 +979,12 @@ Module::FindTypes_Impl (const SymbolCont
size_t
Module::FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
size_t max_matches,
TypeList& type_list)
{
const bool append = true;
- return FindTypes_Impl(sc, type_name, namespace_decl, append, max_matches, type_list);
+ return FindTypes_Impl(sc, type_name, parent_decl_ctx, append, max_matches, type_list);
}
lldb::TypeSP
Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Mon Aug 24 18:46:31 2015
@@ -22,7 +22,6 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/Symbols.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/VariableList.h"
Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Mon Aug 24 18:46:31 2015
@@ -18,7 +18,6 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/RegularExpression.h"
#include "lldb/Core/Stream.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Mon Aug 24 18:46:31 2015
@@ -275,7 +275,7 @@ Value::GetValueByteSize (Error *error_pt
case eContextTypeLLDBType: // Type *
case eContextTypeVariable: // Variable *
{
- const CompilerType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
if (ast_type.IsValid())
byte_size = ast_type.GetByteSize(nullptr);
}
@@ -298,7 +298,7 @@ Value::GetValueByteSize (Error *error_pt
}
const CompilerType &
-Value::GetClangType ()
+Value::GetCompilerType ()
{
if (!m_clang_type.IsValid())
{
@@ -314,7 +314,7 @@ Value::GetClangType ()
{
Type *lldb_type = GetType();
if (lldb_type)
- m_clang_type = lldb_type->GetClangForwardType();
+ m_clang_type = lldb_type->GetForwardCompilerType ();
}
break;
@@ -325,7 +325,7 @@ Value::GetClangType ()
{
Type *variable_type = variable->GetType();
if (variable_type)
- m_clang_type = variable_type->GetClangForwardType();
+ m_clang_type = variable_type->GetForwardCompilerType ();
}
}
break;
@@ -336,7 +336,7 @@ Value::GetClangType ()
}
void
-Value::SetClangType (const CompilerType &clang_type)
+Value::SetCompilerType (const CompilerType &clang_type)
{
m_clang_type = clang_type;
}
@@ -355,7 +355,7 @@ Value::GetValueDefaultFormat ()
case eContextTypeLLDBType:
case eContextTypeVariable:
{
- const CompilerType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
if (ast_type.IsValid())
return ast_type.GetFormat();
}
@@ -407,7 +407,7 @@ Value::GetValueAsData (ExecutionContext
lldb::addr_t address = LLDB_INVALID_ADDRESS;
AddressType address_type = eAddressTypeFile;
Address file_so_addr;
- const CompilerType &ast_type = GetClangType();
+ const CompilerType &ast_type = GetCompilerType();
switch (m_value_type)
{
case eValueTypeVector:
@@ -721,7 +721,7 @@ Value::GetValueAsData (ExecutionContext
Scalar &
Value::ResolveValue(ExecutionContext *exe_ctx)
{
- const CompilerType &clang_type = GetClangType();
+ const CompilerType &clang_type = GetCompilerType();
if (clang_type.IsValid())
{
switch (m_value_type)
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Mon Aug 24 18:46:31 2015
@@ -325,7 +325,7 @@ ValueObject::ClearDynamicTypeInformation
CompilerType
ValueObject::MaybeCalculateCompleteType ()
{
- CompilerType clang_type(GetClangTypeImpl());
+ CompilerType clang_type(GetCompilerTypeImpl());
if (m_did_calculate_complete_objc_class_type)
{
@@ -371,7 +371,7 @@ ValueObject::MaybeCalculateCompleteType
if (complete_objc_class_type_sp)
{
- CompilerType complete_class(complete_objc_class_type_sp->GetClangFullType());
+ CompilerType complete_class(complete_objc_class_type_sp->GetFullCompilerType ());
if (complete_class.GetCompleteType())
{
@@ -396,7 +396,7 @@ ValueObject::MaybeCalculateCompleteType
}
CompilerType
-ValueObject::GetClangType ()
+ValueObject::GetCompilerType ()
{
return MaybeCalculateCompleteType();
}
@@ -404,7 +404,7 @@ ValueObject::GetClangType ()
TypeImpl
ValueObject::GetTypeImpl ()
{
- return TypeImpl(GetClangType());
+ return TypeImpl(GetCompilerType());
}
DataExtractor &
@@ -726,7 +726,7 @@ size_t
ValueObject::GetIndexOfChildWithName (const ConstString &name)
{
bool omit_empty_base_classes = true;
- return GetClangType().GetIndexOfChildWithName (name.GetCString(), omit_empty_base_classes);
+ return GetCompilerType().GetIndexOfChildWithName (name.GetCString(), omit_empty_base_classes);
}
ValueObjectSP
@@ -743,7 +743,7 @@ ValueObject::GetChildMemberWithName (con
std::vector<uint32_t> child_indexes;
bool omit_empty_base_classes = true;
- const size_t num_child_indexes = GetClangType().GetIndexOfChildMemberWithName (name.GetCString(),
+ const size_t num_child_indexes = GetCompilerType().GetIndexOfChildMemberWithName (name.GetCString(),
omit_empty_base_classes,
child_indexes);
if (num_child_indexes > 0)
@@ -834,7 +834,7 @@ ValueObject::CreateChildAtIndex (size_t
ExecutionContext exe_ctx (GetExecutionContextRef());
- child_clang_type = GetClangType().GetChildClangTypeAtIndex (&exe_ctx,
+ child_clang_type = GetCompilerType().GetChildClangTypeAtIndex (&exe_ctx,
idx,
transparent_pointers,
omit_empty_base_classes,
@@ -1046,7 +1046,7 @@ ValueObject::GetPointeeData (DataExtract
break;
case eAddressTypeHost:
{
- const uint64_t max_bytes = GetClangType().GetByteSize(exe_ctx.GetBestExecutionContextScope());
+ const uint64_t max_bytes = GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope());
if (max_bytes > offset)
{
size_t bytes_read = std::min<uint64_t>(max_bytes - offset, bytes);
@@ -1102,7 +1102,7 @@ ValueObject::SetData (DataExtractor &dat
}
uint64_t count = 0;
- const Encoding encoding = GetClangType().GetEncoding(count);
+ const Encoding encoding = GetCompilerType().GetEncoding(count);
const size_t byte_size = GetByteSize();
@@ -1226,7 +1226,7 @@ ValueObject::ReadPointedString (lldb::Da
size_t bytes_read = 0;
size_t total_bytes_read = 0;
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
CompilerType elem_or_pointee_clang_type;
const Flags type_flags (GetTypeInfo (&elem_or_pointee_clang_type));
if (type_flags.AnySet (eTypeIsArray | eTypeIsPointer) &&
@@ -1385,7 +1385,7 @@ ValueObject::GetObjectDescription ()
if (runtime == NULL)
{
// Aw, hell, if the things a pointer, or even just an integer, let's try ObjC anyway...
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
if (clang_type)
{
bool is_signed;
@@ -1449,7 +1449,7 @@ ValueObject::GetValueAsCString ()
}
else
{
- my_format = GetValue().GetClangType().GetFormat();
+ my_format = GetValue().GetCompilerType().GetFormat();
}
}
}
@@ -1886,7 +1886,7 @@ ValueObject::SetValueFromCString (const
}
uint64_t count = 0;
- const Encoding encoding = GetClangType().GetEncoding (count);
+ const Encoding encoding = GetCompilerType().GetEncoding (count);
const size_t byte_size = GetByteSize();
@@ -1984,7 +1984,7 @@ ValueObject::GetDeclaration (Declaration
ConstString
ValueObject::GetTypeName()
{
- return GetClangType().GetConstTypeName();
+ return GetCompilerType().GetConstTypeName();
}
ConstString
@@ -1996,14 +1996,14 @@ ValueObject::GetDisplayTypeName()
ConstString
ValueObject::GetQualifiedTypeName()
{
- return GetClangType().GetConstQualifiedTypeName();
+ return GetCompilerType().GetConstQualifiedTypeName();
}
LanguageType
ValueObject::GetObjectRuntimeLanguage ()
{
- return GetClangType().GetMinimumLanguage ();
+ return GetCompilerType().GetMinimumLanguage ();
}
void
@@ -2025,37 +2025,37 @@ ValueObject::GetSyntheticChild (const Co
uint32_t
ValueObject::GetTypeInfo (CompilerType *pointee_or_element_clang_type)
{
- return GetClangType().GetTypeInfo (pointee_or_element_clang_type);
+ return GetCompilerType().GetTypeInfo (pointee_or_element_clang_type);
}
bool
ValueObject::IsPointerType ()
{
- return GetClangType().IsPointerType();
+ return GetCompilerType().IsPointerType();
}
bool
ValueObject::IsArrayType ()
{
- return GetClangType().IsArrayType (NULL, NULL, NULL);
+ return GetCompilerType().IsArrayType (NULL, NULL, NULL);
}
bool
ValueObject::IsScalarType ()
{
- return GetClangType().IsScalarType ();
+ return GetCompilerType().IsScalarType ();
}
bool
ValueObject::IsIntegerType (bool &is_signed)
{
- return GetClangType().IsIntegerType (is_signed);
+ return GetCompilerType().IsIntegerType (is_signed);
}
bool
ValueObject::IsPointerOrReferenceType ()
{
- return GetClangType().IsPointerOrReferenceType ();
+ return GetCompilerType().IsPointerOrReferenceType ();
}
bool
@@ -2066,7 +2066,7 @@ ValueObject::IsPossibleDynamicType ()
if (process)
return process->IsPossibleDynamicValue(*this);
else
- return GetClangType().IsPossibleDynamicType (NULL, true, true);
+ return GetCompilerType().IsPossibleDynamicType (NULL, true, true);
}
bool
@@ -2088,7 +2088,7 @@ bool
ValueObject::IsObjCNil ()
{
const uint32_t mask = eTypeIsObjC | eTypeIsPointer;
- bool isObjCpointer = (((GetClangType().GetTypeInfo(NULL)) & mask) == mask);
+ bool isObjCpointer = (((GetCompilerType().GetTypeInfo(NULL)) & mask) == mask);
if (!isObjCpointer)
return false;
bool canReadValue = true;
@@ -2156,7 +2156,7 @@ ValueObject::GetSyntheticBitFieldChild (
// We haven't made a synthetic array member for INDEX yet, so
// lets make one and cache it for any future reference.
ValueObjectChild *synthetic_child = new ValueObjectChild (*this,
- GetClangType(),
+ GetCompilerType(),
index_const_str,
GetByteSize(),
0,
@@ -2417,7 +2417,7 @@ ValueObject::GetBaseClassPath (Stream &s
if (IsBaseClass())
{
bool parent_had_base_class = GetParent() && GetParent()->GetBaseClassPath (s);
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
std::string cxx_class_name;
bool this_had_base_class = ClangASTContext::GetCXXClassName (clang_type, cxx_class_name);
if (this_had_base_class)
@@ -2536,7 +2536,7 @@ ValueObject::GetExpressionPath (Stream &
ValueObject *non_base_class_parent = GetNonBaseClassParent();
if (non_base_class_parent)
{
- CompilerType non_base_class_parent_clang_type = non_base_class_parent->GetClangType();
+ CompilerType non_base_class_parent_clang_type = non_base_class_parent->GetCompilerType();
if (non_base_class_parent_clang_type)
{
if (parent && parent->IsDereferenceOfParent() && epformat == eGetExpressionPathFormatHonorPointers)
@@ -2757,7 +2757,7 @@ ValueObject::GetValueForExpressionPath_I
const char* expression_cstr = *first_unparsed; // hide the top level expression_cstr
- CompilerType root_clang_type = root->GetClangType();
+ CompilerType root_clang_type = root->GetCompilerType();
CompilerType pointee_clang_type;
Flags pointee_clang_type_info;
@@ -3073,7 +3073,7 @@ ValueObject::GetValueForExpressionPath_I
}
else
{
- if (root->GetClangType().GetMinimumLanguage() == eLanguageTypeObjC
+ if (root->GetCompilerType().GetMinimumLanguage() == eLanguageTypeObjC
&& pointee_clang_type_info.AllClear(eTypeIsPointer)
&& root->HasSyntheticValue()
&& (options.m_synthetic_children_traversal == GetValueForExpressionPathOptions::SyntheticChildrenTraversal::ToSynthetic ||
@@ -3281,7 +3281,7 @@ ValueObject::ExpandArraySliceExpression(
const char* expression_cstr = *first_unparsed; // hide the top level expression_cstr
- CompilerType root_clang_type = root->GetClangType();
+ CompilerType root_clang_type = root->GetCompilerType();
CompilerType pointee_clang_type;
Flags pointee_clang_type_info;
Flags root_clang_type_info(root_clang_type.GetTypeInfo(&pointee_clang_type));
@@ -3611,7 +3611,7 @@ ValueObject::CreateConstantValue (const
m_error = m_value.GetValueAsData (&exe_ctx, data, 0, GetModule().get());
valobj_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(),
- GetClangType(),
+ GetCompilerType(),
name,
data,
GetAddressOf());
@@ -3678,7 +3678,7 @@ lldb::addr_t
ValueObject::GetCPPVTableAddress (AddressType &address_type)
{
CompilerType pointee_type;
- CompilerType this_type(GetClangType());
+ CompilerType this_type(GetCompilerType());
uint32_t type_info = this_type.GetTypeInfo(&pointee_type);
if (type_info)
{
@@ -3726,7 +3726,7 @@ ValueObject::Dereference (Error &error)
bool child_is_base_class = false;
bool child_is_deref_of_parent = false;
const bool transparent_pointers = false;
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
CompilerType child_clang_type;
ExecutionContext exe_ctx (GetExecutionContextRef());
@@ -3806,7 +3806,7 @@ ValueObject::AddressOf (Error &error)
case eAddressTypeFile:
case eAddressTypeLoad:
{
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
if (clang_type)
{
std::string name (1, '&');
@@ -4258,7 +4258,7 @@ ValueObject::CanProvideValue ()
// we need to support invalid types as providers of values because some bare-board
// debugging scenarios have no notion of types, but still manage to have raw numeric
// values for things like registers. sigh.
- const CompilerType &type(GetClangType());
+ const CompilerType &type(GetCompilerType());
return (false == type.IsValid()) || (0 != (type.GetTypeInfo() & eTypeHasValue));
}
Modified: lldb/trunk/source/Core/ValueObjectCast.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectCast.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectCast.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectCast.cpp Mon Aug 24 18:46:31 2015
@@ -55,7 +55,7 @@ ValueObjectCast::ValueObjectCast
{
SetName (name);
//m_value.SetContext (Value::eContextTypeClangType, cast_type.GetOpaqueQualType());
- m_value.SetClangType (cast_type);
+ m_value.SetCompilerType (cast_type);
}
ValueObjectCast::~ValueObjectCast()
@@ -63,7 +63,7 @@ ValueObjectCast::~ValueObjectCast()
}
CompilerType
-ValueObjectCast::GetClangTypeImpl ()
+ValueObjectCast::GetCompilerTypeImpl ()
{
return m_cast_type;
}
@@ -71,7 +71,7 @@ ValueObjectCast::GetClangTypeImpl ()
size_t
ValueObjectCast::CalculateNumChildren()
{
- return GetClangType().GetNumChildren (true);
+ return GetCompilerType().GetNumChildren (true);
}
uint64_t
@@ -98,9 +98,9 @@ ValueObjectCast::UpdateValue ()
Value old_value(m_value);
m_update_point.SetUpdated();
m_value = m_parent->GetValue();
- CompilerType clang_type (GetClangType());
+ CompilerType clang_type (GetCompilerType());
//m_value.SetContext (Value::eContextTypeClangType, clang_type);
- m_value.SetClangType (clang_type);
+ m_value.SetCompilerType (clang_type);
SetAddressTypeOfChildren(m_parent->GetAddressTypeOfChildren());
if (!CanProvideValue())
{
Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Mon Aug 24 18:46:31 2015
@@ -64,7 +64,7 @@ ValueObjectChild::GetValueType() const
size_t
ValueObjectChild::CalculateNumChildren()
{
- return GetClangType().GetNumChildren (true);
+ return GetCompilerType().GetNumChildren (true);
}
static void
@@ -88,7 +88,7 @@ ValueObjectChild::GetTypeName()
{
if (m_type_name.IsEmpty())
{
- m_type_name = GetClangType().GetConstTypeName ();
+ m_type_name = GetCompilerType().GetConstTypeName ();
AdjustForBitfieldness(m_type_name, m_bitfield_bit_size);
}
return m_type_name;
@@ -97,7 +97,7 @@ ValueObjectChild::GetTypeName()
ConstString
ValueObjectChild::GetQualifiedTypeName()
{
- ConstString qualified_name = GetClangType().GetConstTypeName();
+ ConstString qualified_name = GetCompilerType().GetConstTypeName();
AdjustForBitfieldness(qualified_name, m_bitfield_bit_size);
return qualified_name;
}
@@ -105,7 +105,7 @@ ValueObjectChild::GetQualifiedTypeName()
ConstString
ValueObjectChild::GetDisplayTypeName()
{
- ConstString display_name = GetClangType().GetDisplayTypeName();
+ ConstString display_name = GetCompilerType().GetDisplayTypeName();
AdjustForBitfieldness(display_name, m_bitfield_bit_size);
return display_name;
}
@@ -136,14 +136,14 @@ ValueObjectChild::UpdateValue ()
{
if (parent->UpdateValueIfNeeded(false))
{
- m_value.SetClangType(GetClangType());
+ m_value.SetCompilerType(GetCompilerType());
// Copy the parent scalar value and the scalar value type
m_value.GetScalar() = parent->GetValue().GetScalar();
Value::ValueType value_type = parent->GetValue().GetValueType();
m_value.SetValueType (value_type);
- if (parent->GetClangType().IsPointerOrReferenceType ())
+ if (parent->GetCompilerType().IsPointerOrReferenceType ())
{
lldb::addr_t addr = parent->GetPointerValue ();
m_value.GetScalar() = addr;
@@ -225,7 +225,7 @@ ValueObjectChild::UpdateValue ()
{
const bool thread_and_frame_only_if_stopped = true;
ExecutionContext exe_ctx (GetExecutionContextRef().Lock(thread_and_frame_only_if_stopped));
- if (GetClangType().GetTypeInfo() & lldb::eTypeHasValue)
+ if (GetCompilerType().GetTypeInfo() & lldb::eTypeHasValue)
m_error = m_value.GetValueAsData (&exe_ctx, m_data, 0, GetModule().get());
else
m_error.Clear(); // No value so nothing to read...
Modified: lldb/trunk/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResult.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResult.cpp Mon Aug 24 18:46:31 2015
@@ -94,7 +94,7 @@ ValueObjectConstResult::ValueObjectConst
m_value.GetScalar() = (uintptr_t)m_data.GetDataStart();
m_value.SetValueType(Value::eValueTypeHostAddress);
- m_value.SetClangType(clang_type);
+ m_value.SetCompilerType(clang_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -146,7 +146,7 @@ ValueObjectConstResult::ValueObjectConst
m_value.GetScalar() = (uintptr_t)data_sp->GetBytes();
m_value.SetValueType(Value::eValueTypeHostAddress);
//m_value.SetContext(Value::eContextTypeClangType, clang_type);
- m_value.SetClangType (clang_type);
+ m_value.SetCompilerType (clang_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -192,7 +192,7 @@ ValueObjectConstResult::ValueObjectConst
case eAddressTypeHost: m_value.SetValueType(Value::eValueTypeHostAddress); break;
}
// m_value.SetContext(Value::eContextTypeClangType, clang_type);
- m_value.SetClangType (clang_type);
+ m_value.SetCompilerType (clang_type);
m_name = name;
SetIsConstant ();
SetValueIsValid(true);
@@ -242,9 +242,9 @@ ValueObjectConstResult::~ValueObjectCons
}
CompilerType
-ValueObjectConstResult::GetClangTypeImpl()
+ValueObjectConstResult::GetCompilerTypeImpl()
{
- return m_value.GetClangType();
+ return m_value.GetCompilerType();
}
lldb::ValueType
@@ -259,7 +259,7 @@ ValueObjectConstResult::GetByteSize()
ExecutionContext exe_ctx(GetExecutionContextRef());
if (m_byte_size == 0)
- SetByteSize(GetClangType().GetByteSize(exe_ctx.GetBestExecutionContextScope()));
+ SetByteSize(GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope()));
return m_byte_size;
}
@@ -272,21 +272,21 @@ ValueObjectConstResult::SetByteSize (siz
size_t
ValueObjectConstResult::CalculateNumChildren()
{
- return GetClangType().GetNumChildren (true);
+ return GetCompilerType().GetNumChildren (true);
}
ConstString
ValueObjectConstResult::GetTypeName()
{
if (m_type_name.IsEmpty())
- m_type_name = GetClangType().GetConstTypeName ();
+ m_type_name = GetCompilerType().GetConstTypeName ();
return m_type_name;
}
ConstString
ValueObjectConstResult::GetDisplayTypeName()
{
- return GetClangType().GetDisplayTypeName();
+ return GetCompilerType().GetDisplayTypeName();
}
bool
Modified: lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp Mon Aug 24 18:46:31 2015
@@ -71,7 +71,7 @@ ValueObjectConstResultImpl::CreateChildA
bool child_is_deref_of_parent = false;
const bool transparent_pointers = synthetic_array_member == false;
- CompilerType clang_type = m_impl_backend->GetClangType();
+ CompilerType clang_type = m_impl_backend->GetCompilerType();
CompilerType child_clang_type;
ExecutionContext exe_ctx (m_impl_backend->GetExecutionContextRef());
@@ -132,7 +132,7 @@ ValueObjectConstResultImpl::AddressOf (E
return lldb::ValueObjectSP();
if (m_live_address != LLDB_INVALID_ADDRESS)
{
- CompilerType clang_type(m_impl_backend->GetClangType());
+ CompilerType clang_type(m_impl_backend->GetCompilerType());
lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&m_live_address,sizeof(lldb::addr_t)));
Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Mon Aug 24 18:46:31 2015
@@ -50,17 +50,17 @@ ValueObjectDynamicValue::~ValueObjectDyn
}
CompilerType
-ValueObjectDynamicValue::GetClangTypeImpl ()
+ValueObjectDynamicValue::GetCompilerTypeImpl ()
{
const bool success = UpdateValueIfNeeded(false);
if (success)
{
if (m_dynamic_type_info.HasType())
- return m_value.GetClangType();
+ return m_value.GetCompilerType();
else
- return m_parent->GetClangType();
+ return m_parent->GetCompilerType();
}
- return m_parent->GetClangType();
+ return m_parent->GetCompilerType();
}
ConstString
@@ -105,7 +105,7 @@ ValueObjectDynamicValue::GetDisplayTypeN
if (success)
{
if (m_dynamic_type_info.HasType())
- return GetClangType().GetDisplayTypeName();
+ return GetCompilerType().GetDisplayTypeName();
if (m_dynamic_type_info.HasName())
return m_dynamic_type_info.GetName();
}
@@ -117,7 +117,7 @@ ValueObjectDynamicValue::CalculateNumChi
{
const bool success = UpdateValueIfNeeded(false);
if (success && m_dynamic_type_info.HasType())
- return GetClangType().GetNumChildren (true);
+ return GetCompilerType().GetNumChildren (true);
else
return m_parent->GetNumChildren();
}
@@ -166,7 +166,7 @@ FixupTypeAndOrName (const TypeAndOrName&
else if (parent.IsPointerOrReferenceType())
corrected_name.append(" &");
// the parent type should be a correctly pointer'ed or referenc'ed type
- ret.SetCompilerType(parent.GetClangType());
+ ret.SetCompilerType(parent.GetCompilerType());
ret.SetName(corrected_name.c_str());
}
return ret;
@@ -241,7 +241,7 @@ ValueObjectDynamicValue::UpdateValue ()
{
if (class_type_or_name.HasType())
{
- m_type_impl = TypeImpl(m_parent->GetClangType(),FixupTypeAndOrName(class_type_or_name, *m_parent).GetCompilerType());
+ m_type_impl = TypeImpl(m_parent->GetCompilerType(),FixupTypeAndOrName(class_type_or_name, *m_parent).GetCompilerType());
}
else
{
@@ -303,7 +303,7 @@ ValueObjectDynamicValue::UpdateValue ()
m_dynamic_type_info = FixupTypeAndOrName(m_dynamic_type_info, *m_parent);
//m_value.SetContext (Value::eContextTypeClangType, corrected_type);
- m_value.SetClangType (m_dynamic_type_info.GetCompilerType());
+ m_value.SetCompilerType (m_dynamic_type_info.GetCompilerType());
// Our address is the location of the dynamic type stored in memory. It isn't a load address,
// because we aren't pointing to the LOCATION that stores the pointer to us, we're pointing to us...
Modified: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Mon Aug 24 18:46:31 2015
@@ -104,7 +104,7 @@ ValueObjectMemory::ValueObjectMemory (Ex
SetName (ConstString(name));
// m_value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType());
- m_value.SetClangType(m_clang_type);
+ m_value.SetCompilerType(m_clang_type);
lldb::addr_t load_address = m_address.GetLoadAddress (target_sp.get());
if (load_address != LLDB_INVALID_ADDRESS)
{
@@ -132,10 +132,10 @@ ValueObjectMemory::~ValueObjectMemory()
}
CompilerType
-ValueObjectMemory::GetClangTypeImpl ()
+ValueObjectMemory::GetCompilerTypeImpl ()
{
if (m_type_sp)
- return m_type_sp->GetClangForwardType();
+ return m_type_sp->GetForwardCompilerType ();
return m_clang_type;
}
@@ -151,7 +151,7 @@ ConstString
ValueObjectMemory::GetDisplayTypeName()
{
if (m_type_sp)
- return m_type_sp->GetClangForwardType().GetDisplayTypeName();
+ return m_type_sp->GetForwardCompilerType ().GetDisplayTypeName();
return m_clang_type.GetDisplayTypeName();
}
@@ -250,7 +250,7 @@ ValueObjectMemory::UpdateValue ()
else
{
//value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType());
- value.SetClangType(m_clang_type);
+ value.SetCompilerType(m_clang_type);
}
m_error = value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Mon Aug 24 18:46:31 2015
@@ -43,7 +43,7 @@ ValueObjectRegisterContext::~ValueObject
}
CompilerType
-ValueObjectRegisterContext::GetClangTypeImpl ()
+ValueObjectRegisterContext::GetCompilerTypeImpl ()
{
return CompilerType();
}
@@ -145,7 +145,7 @@ ValueObjectRegisterSet::~ValueObjectRegi
}
CompilerType
-ValueObjectRegisterSet::GetClangTypeImpl ()
+ValueObjectRegisterSet::GetCompilerTypeImpl ()
{
return CompilerType();
}
@@ -308,7 +308,7 @@ ValueObjectRegister::~ValueObjectRegiste
}
CompilerType
-ValueObjectRegister::GetClangTypeImpl ()
+ValueObjectRegister::GetCompilerTypeImpl ()
{
if (!m_clang_type.IsValid())
{
@@ -331,14 +331,14 @@ ConstString
ValueObjectRegister::GetTypeName()
{
if (m_type_name.IsEmpty())
- m_type_name = GetClangType().GetConstTypeName ();
+ m_type_name = GetCompilerType().GetConstTypeName ();
return m_type_name;
}
size_t
ValueObjectRegister::CalculateNumChildren()
{
- return GetClangType().GetNumChildren(true);
+ return GetCompilerType().GetNumChildren(true);
}
uint64_t
Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Mon Aug 24 18:46:31 2015
@@ -83,9 +83,9 @@ ValueObjectSynthetic::~ValueObjectSynthe
}
CompilerType
-ValueObjectSynthetic::GetClangTypeImpl ()
+ValueObjectSynthetic::GetCompilerTypeImpl ()
{
- return m_parent->GetClangType();
+ return m_parent->GetCompilerType();
}
ConstString
Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Mon Aug 24 18:46:31 2015
@@ -55,11 +55,11 @@ ValueObjectVariable::~ValueObjectVariabl
}
CompilerType
-ValueObjectVariable::GetClangTypeImpl ()
+ValueObjectVariable::GetCompilerTypeImpl ()
{
Type *var_type = m_variable_sp->GetType();
if (var_type)
- return var_type->GetClangForwardType();
+ return var_type->GetForwardCompilerType ();
return CompilerType();
}
@@ -77,7 +77,7 @@ ValueObjectVariable::GetDisplayTypeName(
{
Type * var_type = m_variable_sp->GetType();
if (var_type)
- return var_type->GetClangForwardType().GetDisplayTypeName();
+ return var_type->GetForwardCompilerType ().GetDisplayTypeName();
return ConstString();
}
@@ -93,7 +93,7 @@ ValueObjectVariable::GetQualifiedTypeNam
size_t
ValueObjectVariable::CalculateNumChildren()
{
- CompilerType type(GetClangType());
+ CompilerType type(GetCompilerType());
if (!type.IsValid())
return 0;
@@ -107,7 +107,7 @@ ValueObjectVariable::GetByteSize()
{
ExecutionContext exe_ctx(GetExecutionContextRef());
- CompilerType type(GetClangType());
+ CompilerType type(GetCompilerType());
if (!type.IsValid())
return 0;
@@ -168,9 +168,9 @@ ValueObjectVariable::UpdateValue ()
m_resolved_value = m_value;
m_value.SetContext(Value::eContextTypeVariable, variable);
- CompilerType clang_type = GetClangType();
+ CompilerType clang_type = GetCompilerType();
if (clang_type.IsValid())
- m_value.SetClangType(clang_type);
+ m_value.SetCompilerType(clang_type);
Value::ValueType value_type = m_value.GetValueType();
Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Mon Aug 24 18:46:31 2015
@@ -312,13 +312,12 @@ lldb_private::formatters::WCharStringSum
if (data_addr == 0 || data_addr == LLDB_INVALID_ADDRESS)
return false;
- ClangASTContext* lldb_ast = valobj.GetClangType().GetTypeSystem()->AsClangASTContext();
- clang::ASTContext* ast = lldb_ast ? lldb_ast->getASTContext() : nullptr;
-
- if (!ast)
+ // Get a wchar_t basic type from the current type system
+ CompilerType wchar_clang_type = valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeWChar);
+
+ if (!wchar_clang_type)
return false;
- CompilerType wchar_clang_type = ClangASTContext::GetBasicType(ast, lldb::eBasicTypeWChar);
const uint32_t wchar_size = wchar_clang_type.GetBitSize(nullptr); // Safe to pass NULL for exe_scope here
ReadStringAndDumpToStreamOptions options(valobj);
@@ -1034,7 +1033,7 @@ lldb_private::formatters::NSAttributedSt
if (!pointer_value)
return false;
pointer_value += addr_size;
- CompilerType type(valobj.GetClangType());
+ CompilerType type(valobj.GetCompilerType());
ExecutionContext exe_ctx(target_sp,false);
ValueObjectSP child_ptr_sp(valobj.CreateValueObjectFromAddress("string_ptr", pointer_value, exe_ctx, type));
if (!child_ptr_sp)
@@ -1067,7 +1066,7 @@ lldb_private::formatters::RuntimeSpecifi
bool
lldb_private::formatters::ObjCBOOLSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
- const uint32_t type_info = valobj.GetClangType().GetTypeInfo();
+ const uint32_t type_info = valobj.GetCompilerType().GetTypeInfo();
ValueObjectSP real_guy_sp = valobj.GetSP();
@@ -1100,7 +1099,7 @@ lldb_private::formatters::ObjCSELSummary
{
lldb::ValueObjectSP valobj_sp;
- CompilerType charstar (valobj.GetClangType().GetBasicTypeFromAST(eBasicTypeChar).GetPointerType());
+ CompilerType charstar (valobj.GetCompilerType().GetBasicTypeFromAST(eBasicTypeChar).GetPointerType());
if (!charstar)
return false;
@@ -1204,7 +1203,7 @@ lldb_private::formatters::VectorIterator
return false;
Error err;
m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();
- m_item_sp = CreateValueObjectFromAddress("item", item_ptr->GetValueAsUnsigned(0), m_exe_ctx_ref, item_ptr->GetClangType().GetPointeeType());
+ m_item_sp = CreateValueObjectFromAddress("item", item_ptr->GetValueAsUnsigned(0), m_exe_ctx_ref, item_ptr->GetCompilerType().GetPointeeType());
if (err.Fail())
m_item_sp.reset();
return false;
Modified: lldb/trunk/source/DataFormatters/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/Cocoa.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/Cocoa.cpp (original)
+++ lldb/trunk/source/DataFormatters/Cocoa.cpp Mon Aug 24 18:46:31 2015
@@ -55,7 +55,7 @@ lldb_private::formatters::NSBundleSummar
if (!strcmp(class_name,"NSBundle"))
{
uint64_t offset = 5 * ptr_size;
- ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetClangType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID), true));
+ ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID), true));
StreamString summary_stream;
bool was_nsstring_ok = NSStringSummaryProvider(*text.get(), summary_stream, options);
@@ -102,7 +102,7 @@ lldb_private::formatters::NSTimeZoneSumm
if (!strcmp(class_name,"__NSTimeZone"))
{
uint64_t offset = ptr_size;
- ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetClangType(), true));
+ ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetCompilerType(), true));
StreamString summary_stream;
bool was_nsstring_ok = NSStringSummaryProvider(*text.get(), summary_stream, options);
if (was_nsstring_ok && summary_stream.GetSize() > 0)
@@ -146,7 +146,7 @@ lldb_private::formatters::NSNotification
if (!strcmp(class_name,"NSConcreteNotification"))
{
uint64_t offset = ptr_size;
- ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetClangType(), true));
+ ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, valobj.GetCompilerType(), true));
StreamString summary_stream;
bool was_nsstring_ok = NSStringSummaryProvider(*text.get(), summary_stream, options);
if (was_nsstring_ok && summary_stream.GetSize() > 0)
@@ -443,7 +443,7 @@ lldb_private::formatters::NSURLSummaryPr
{
uint64_t offset_text = ptr_size + ptr_size + 8; // ISA + pointer + 8 bytes of data (even on 32bit)
uint64_t offset_base = offset_text + ptr_size;
- CompilerType type(valobj.GetClangType());
+ CompilerType type(valobj.GetCompilerType());
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset_text, type, true));
ValueObjectSP base(valobj.GetSyntheticChildAtOffset(offset_base, type, true));
if (!text)
Modified: lldb/trunk/source/DataFormatters/CoreMedia.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CoreMedia.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CoreMedia.cpp (original)
+++ lldb/trunk/source/DataFormatters/CoreMedia.cpp Mon Aug 24 18:46:31 2015
@@ -21,9 +21,9 @@ using namespace lldb_private::formatters
bool
lldb_private::formatters::CMTimeSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
- if (!valobj.GetClangType().IsValid())
+ if (!valobj.GetCompilerType().IsValid())
return false;
- ClangASTContext *ast_ctx = valobj.GetClangType().GetTypeSystem()->AsClangASTContext();
+ ClangASTContext *ast_ctx = valobj.GetCompilerType().GetTypeSystem()->AsClangASTContext();
if (!ast_ctx)
return false;
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Aug 24 18:46:31 2015
@@ -313,7 +313,7 @@ FormatManager::GetPossibleMatches (Value
lldb::ValueObjectSP static_value_sp(valobj.GetStaticValue());
if (static_value_sp)
GetPossibleMatches(*static_value_sp.get(),
- static_value_sp->GetClangType(),
+ static_value_sp->GetCompilerType(),
reason | lldb_private::eFormatterChoiceCriterionWentToStaticValue,
use_dynamic,
entries,
@@ -1602,7 +1602,7 @@ FormatManager::LoadHardcodedFormatters()
lldb::DynamicValueType,
FormatManager&) -> TypeSummaryImpl::SharedPointer {
static CXXFunctionSummaryFormat::SharedPointer formatter_sp(new CXXFunctionSummaryFormat(TypeSummaryImpl::Flags(), lldb_private::formatters::FunctionPointerSummaryProvider, "Function pointer summary provider"));
- if (valobj.GetClangType().IsFunctionPointerType())
+ if (valobj.GetCompilerType().IsFunctionPointerType())
{
return formatter_sp;
}
@@ -1621,7 +1621,7 @@ FormatManager::LoadHardcodedFormatters()
.SetSkipReferences(false),
lldb_private::formatters::VectorTypeSummaryProvider,
"vector_type pointer summary provider"));
- if (valobj.GetClangType().IsVectorType(nullptr, nullptr))
+ if (valobj.GetCompilerType().IsVectorType(nullptr, nullptr))
{
if (fmt_mgr.GetCategory(fmt_mgr.m_vectortypes_category_name)->IsEnabled())
return formatter_sp;
@@ -1638,7 +1638,7 @@ FormatManager::LoadHardcodedFormatters()
static CXXSyntheticChildren::SharedPointer formatter_sp(new CXXSyntheticChildren(SyntheticChildren::Flags().SetCascades(true).SetSkipPointers(true).SetSkipReferences(true).SetNonCacheable(true),
"vector_type synthetic children",
lldb_private::formatters::VectorTypeSyntheticFrontEndCreator));
- if (valobj.GetClangType().IsVectorType(nullptr, nullptr))
+ if (valobj.GetCompilerType().IsVectorType(nullptr, nullptr))
{
if (fmt_mgr.GetCategory(fmt_mgr.m_vectortypes_category_name)->IsEnabled())
return formatter_sp;
Modified: lldb/trunk/source/DataFormatters/LibCxx.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxx.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxx.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxx.cpp Mon Aug 24 18:46:31 2015
@@ -81,7 +81,7 @@ m_children()
if (valobj_sp)
{
Update();
- m_bool_type = valobj_sp->GetClangType().GetBasicTypeFromAST(lldb::eBasicTypeBool);
+ m_bool_type = valobj_sp->GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeBool);
}
}
@@ -377,7 +377,7 @@ lldb_private::formatters::LibcxxSharedPt
return lldb::ValueObjectSP();
uint64_t count = 1 + shared_owners_sp->GetValueAsUnsigned(0);
DataExtractor data(&count, 8, m_byte_order, m_ptr_size);
- m_count_sp = CreateValueObjectFromData("count", data, valobj_sp->GetExecutionContextRef(), shared_owners_sp->GetClangType());
+ m_count_sp = CreateValueObjectFromData("count", data, valobj_sp->GetExecutionContextRef(), shared_owners_sp->GetCompilerType());
}
return m_count_sp;
}
@@ -390,7 +390,7 @@ lldb_private::formatters::LibcxxSharedPt
return lldb::ValueObjectSP();
uint64_t count = 1 + shared_weak_owners_sp->GetValueAsUnsigned(0);
DataExtractor data(&count, 8, m_byte_order, m_ptr_size);
- m_weak_count_sp = CreateValueObjectFromData("count", data, valobj_sp->GetExecutionContextRef(), shared_weak_owners_sp->GetClangType());
+ m_weak_count_sp = CreateValueObjectFromData("count", data, valobj_sp->GetExecutionContextRef(), shared_weak_owners_sp->GetCompilerType());
}
return m_weak_count_sp;
}
Modified: lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxInitializerList.cpp Mon Aug 24 18:46:31 2015
@@ -101,7 +101,7 @@ lldb_private::formatters::LibcxxInitiali
m_num_elements = 0;
m_children.clear();
lldb::TemplateArgumentKind kind;
- m_element_type = m_backend.GetClangType().GetTemplateArgument(0, kind);
+ m_element_type = m_backend.GetCompilerType().GetTemplateArgument(0, kind);
if (kind != lldb::eTemplateArgumentKindType || false == m_element_type.IsValid())
return false;
Modified: lldb/trunk/source/DataFormatters/LibCxxList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxList.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxxList.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxList.cpp Mon Aug 24 18:46:31 2015
@@ -332,7 +332,7 @@ lldb_private::formatters::LibcxxStdListS
ValueObjectSP impl_sp(m_backend.GetChildMemberWithName(ConstString("__end_"),true));
if (!impl_sp)
return false;
- CompilerType list_type = m_backend.GetClangType();
+ CompilerType list_type = m_backend.GetCompilerType();
if (list_type.IsReferenceType())
list_type = list_type.GetNonReferenceType();
Modified: lldb/trunk/source/DataFormatters/LibCxxMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxMap.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxxMap.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxMap.cpp Mon Aug 24 18:46:31 2015
@@ -290,7 +290,7 @@ lldb_private::formatters::LibcxxStdMapSy
deref = deref->GetChildMemberWithName(ConstString("__value_"), true);
if (!deref)
return false;
- m_element_type = deref->GetClangType();
+ m_element_type = deref->GetCompilerType();
return true;
}
@@ -301,7 +301,7 @@ lldb_private::formatters::LibcxxStdMapSy
return;
if (!node)
return;
- CompilerType node_type(node->GetClangType());
+ CompilerType node_type(node->GetCompilerType());
uint64_t bit_offset;
if (node_type.GetIndexOfFieldWithName("__value_", NULL, &bit_offset) == UINT32_MAX)
return;
Modified: lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxUnorderedMap.cpp Mon Aug 24 18:46:31 2015
@@ -125,7 +125,7 @@ lldb_private::formatters::LibcxxStdUnord
return val_hash.first->CreateValueObjectFromData(stream.GetData(),
data,
exe_ctx,
- val_hash.first->GetClangType());
+ val_hash.first->GetCompilerType());
}
bool
Modified: lldb/trunk/source/DataFormatters/LibCxxVector.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibCxxVector.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibCxxVector.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibCxxVector.cpp Mon Aug 24 18:46:31 2015
@@ -112,7 +112,7 @@ lldb_private::formatters::LibcxxStdVecto
data_type_finder_sp = data_type_finder_sp->GetChildMemberWithName(ConstString("__first_"),true);
if (!data_type_finder_sp)
return false;
- m_element_type = data_type_finder_sp->GetClangType().GetPointeeType();
+ m_element_type = data_type_finder_sp->GetCompilerType().GetPointeeType();
m_element_size = m_element_type.GetByteSize(nullptr);
if (m_element_size > 0)
Modified: lldb/trunk/source/DataFormatters/LibStdcpp.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/LibStdcpp.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/LibStdcpp.cpp (original)
+++ lldb/trunk/source/DataFormatters/LibStdcpp.cpp Mon Aug 24 18:46:31 2015
@@ -78,7 +78,7 @@ lldb_private::formatters::LibstdcppMapIt
m_pair_address += (is_64bit ? 32 : 16);
- CompilerType my_type(valobj_sp->GetClangType());
+ CompilerType my_type(valobj_sp->GetCompilerType());
if (my_type.GetNumTemplateArguments() >= 1)
{
TemplateArgumentKind kind;
Modified: lldb/trunk/source/DataFormatters/NSArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSArray.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSArray.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSArray.cpp Mon Aug 24 18:46:31 2015
@@ -528,9 +528,9 @@ lldb_private::formatters::NSArrayISynthe
m_items (0),
m_data_ptr (0)
{
- if (valobj_sp && valobj_sp->GetClangType().IsValid())
+ if (valobj_sp && valobj_sp->GetCompilerType().IsValid())
{
- ClangASTContext *ast = valobj_sp->GetClangType().GetTypeSystem()->AsClangASTContext();
+ ClangASTContext *ast = valobj_sp->GetCompilerType().GetTypeSystem()->AsClangASTContext();
if (ast)
m_id_type = CompilerType(ast->getASTContext(), ast->getASTContext()->ObjCBuiltinIdTy);
}
@@ -622,7 +622,7 @@ SyntheticChildrenFrontEnd* lldb_private:
if (!runtime)
return NULL;
- CompilerType valobj_type(valobj_sp->GetClangType());
+ CompilerType valobj_type(valobj_sp->GetCompilerType());
Flags flags(valobj_type.GetTypeInfo());
if (flags.IsClear(eTypeIsPointer))
Modified: lldb/trunk/source/DataFormatters/NSIndexPath.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSIndexPath.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSIndexPath.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSIndexPath.cpp Mon Aug 24 18:46:31 2015
@@ -49,7 +49,7 @@ public:
{
m_impl.Clear();
- TypeSystem* type_system = m_backend.GetClangType().GetTypeSystem();
+ TypeSystem* type_system = m_backend.GetCompilerType().GetTypeSystem();
if (!type_system)
return false;
m_ast_ctx = type_system->AsClangASTContext();
@@ -227,7 +227,7 @@ protected:
v = Value(scalar);
}
- v.SetClangType(desired_type);
+ v.SetCompilerType(desired_type);
StreamString idx_name;
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
Modified: lldb/trunk/source/DataFormatters/NSSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/NSSet.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/NSSet.cpp (original)
+++ lldb/trunk/source/DataFormatters/NSSet.cpp Mon Aug 24 18:46:31 2015
@@ -470,7 +470,7 @@ lldb_private::formatters::NSSetISyntheti
CreateValueObjectFromData(idx_name.GetData(),
data,
m_exe_ctx_ref,
- m_backend.GetClangType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID));
+ m_backend.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID));
}
return set_item.valobj_sp;
}
@@ -638,7 +638,7 @@ lldb_private::formatters::NSSetMSyntheti
CreateValueObjectFromData(idx_name.GetData(),
data,
m_exe_ctx_ref,
- m_backend.GetClangType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID));
+ m_backend.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID));
}
return set_item.valobj_sp;
}
Modified: lldb/trunk/source/DataFormatters/TypeFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeFormat.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeFormat.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeFormat.cpp Mon Aug 24 18:46:31 2015
@@ -91,7 +91,7 @@ TypeFormatImpl_Format::FormatObject (Val
}
else
{
- CompilerType clang_type = value.GetClangType ();
+ CompilerType clang_type = value.GetCompilerType ();
if (clang_type)
{
// put custom bytes to display in the DataExtractor to override the default value logic
@@ -208,9 +208,9 @@ TypeFormatImpl_EnumType::FormatObject (V
{
if (!type_sp)
continue;
- if ( (type_sp->GetClangForwardType().GetTypeInfo() & eTypeIsEnumeration) == eTypeIsEnumeration)
+ if ( (type_sp->GetForwardCompilerType().GetTypeInfo() & eTypeIsEnumeration) == eTypeIsEnumeration)
{
- valobj_enum_type = type_sp->GetClangFullType();
+ valobj_enum_type = type_sp->GetFullCompilerType ();
m_types.emplace(valobj_key,valobj_enum_type);
break;
}
Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original)
+++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Mon Aug 24 18:46:31 2015
@@ -176,7 +176,7 @@ ValueObjectPrinter::GetMostSpecializedVa
}
}
}
- m_clang_type = m_valobj->GetClangType();
+ m_clang_type = m_valobj->GetCompilerType();
m_type_flags = m_clang_type.GetTypeInfo ();
return true;
}
Modified: lldb/trunk/source/DataFormatters/VectorType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/VectorType.cpp (original)
+++ lldb/trunk/source/DataFormatters/VectorType.cpp Mon Aug 24 18:46:31 2015
@@ -21,7 +21,7 @@ using namespace lldb_private;
using namespace lldb_private::formatters;
static CompilerType
-GetClangTypeForFormat (lldb::Format format,
+GetCompilerTypeForFormat (lldb::Format format,
CompilerType element_type,
ClangASTContext *ast_ctx)
{
@@ -229,10 +229,10 @@ namespace lldb_private {
Update()
{
m_parent_format = m_backend.GetFormat();
- CompilerType parent_type(m_backend.GetClangType());
+ CompilerType parent_type(m_backend.GetCompilerType());
CompilerType element_type;
parent_type.IsVectorType(&element_type, nullptr);
- m_child_type = ::GetClangTypeForFormat(m_parent_format, element_type, parent_type.GetTypeSystem()->AsClangASTContext());
+ m_child_type = ::GetCompilerTypeForFormat(m_parent_format, element_type, parent_type.GetTypeSystem()->AsClangASTContext());
m_num_children = ::CalculateNumChildren(parent_type,
m_child_type);
m_item_format = GetItemFormatForFormat(m_parent_format,
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Mon Aug 24 18:46:31 2015
@@ -18,7 +18,7 @@
#include "lldb/Expression/ClangExpression.h"
#include "lldb/Expression/ClangModulesDeclVendor.h"
#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
+#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/TaggedASTType.h"
@@ -252,7 +252,7 @@ ClangASTSource::CompleteType (TagDecl *t
if (log)
log->Printf(" CTD[%u] Searching namespace %s in module %s",
current_id,
- i->second.GetNamespaceDecl()->getNameAsString().c_str(),
+ i->second.GetName().AsCString(),
i->first->GetFileSpec().GetFilename().GetCString());
TypeList types;
@@ -271,7 +271,7 @@ ClangASTSource::CompleteType (TagDecl *t
if (!type)
continue;
- CompilerType clang_type (type->GetClangFullType());
+ CompilerType clang_type (type->GetFullCompilerType ());
if (!clang_type)
continue;
@@ -294,7 +294,7 @@ ClangASTSource::CompleteType (TagDecl *t
SymbolContext null_sc;
ConstString name(tag_decl->getName().str().c_str());
- ClangNamespaceDecl namespace_decl;
+ CompilerDeclContext namespace_decl;
const ModuleList &module_list = m_target->GetImages();
@@ -310,7 +310,7 @@ ClangASTSource::CompleteType (TagDecl *t
if (!type)
continue;
- CompilerType clang_type (type->GetClangFullType());
+ CompilerType clang_type (type->GetFullCompilerType ());
if (!clang_type)
continue;
@@ -401,7 +401,7 @@ ClangASTSource::GetCompleteObjCInterface
if (!complete_type_sp)
return NULL;
- TypeFromUser complete_type = TypeFromUser(complete_type_sp->GetClangFullType());
+ TypeFromUser complete_type = TypeFromUser(complete_type_sp->GetFullCompilerType ());
lldb::clang_type_t complete_opaque_type = complete_type.GetOpaqueQualType();
if (!complete_opaque_type)
@@ -598,7 +598,7 @@ ClangASTSource::FindExternalVisibleDecls
if (log)
log->Printf(" CAS::FEVD[%u] Searching namespace %s in module %s",
current_id,
- i->second.GetNamespaceDecl()->getNameAsString().c_str(),
+ i->second.GetName().AsCString(),
i->first->GetFileSpec().GetFilename().GetCString());
FindExternalVisibleDecls(context,
@@ -618,7 +618,7 @@ ClangASTSource::FindExternalVisibleDecls
}
else
{
- ClangNamespaceDecl namespace_decl;
+ CompilerDeclContext namespace_decl;
if (log)
log->Printf(" CAS::FEVD[%u] Searching the root namespace", current_id);
@@ -647,7 +647,7 @@ ClangASTSource::FindExternalVisibleDecls
void
ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
lldb::ModuleSP module_sp,
- ClangNamespaceDecl &namespace_decl,
+ CompilerDeclContext &namespace_decl,
unsigned int current_id)
{
assert (m_ast_context);
@@ -675,7 +675,7 @@ ClangASTSource::FindExternalVisibleDecls
if (module_sp && namespace_decl)
{
- ClangNamespaceDecl found_namespace_decl;
+ CompilerDeclContext found_namespace_decl;
SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
@@ -687,7 +687,7 @@ ClangASTSource::FindExternalVisibleDecls
if (found_namespace_decl)
{
- context.m_namespace_map->push_back(std::pair<lldb::ModuleSP, ClangNamespaceDecl>(module_sp, found_namespace_decl));
+ context.m_namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(module_sp, found_namespace_decl));
if (log)
log->Printf(" CAS::FEVD[%u] Found namespace %s in module %s",
@@ -709,7 +709,7 @@ ClangASTSource::FindExternalVisibleDecls
if (!image)
continue;
- ClangNamespaceDecl found_namespace_decl;
+ CompilerDeclContext found_namespace_decl;
SymbolVendor *symbol_vendor = image->GetSymbolVendor();
@@ -722,7 +722,7 @@ ClangASTSource::FindExternalVisibleDecls
if (found_namespace_decl)
{
- context.m_namespace_map->push_back(std::pair<lldb::ModuleSP, ClangNamespaceDecl>(image, found_namespace_decl));
+ context.m_namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(image, found_namespace_decl));
if (log)
log->Printf(" CAS::FEVD[%u] Found namespace %s in module %s",
@@ -760,7 +760,7 @@ ClangASTSource::FindExternalVisibleDecls
(name_string ? name_string : "<anonymous>"));
}
- CompilerType full_type = type_sp->GetClangFullType();
+ CompilerType full_type = type_sp->GetFullCompilerType ();
CompilerType copied_clang_type (GuardedCopyType(full_type));
@@ -1204,12 +1204,11 @@ ClangASTSource::FindObjCMethodDecls (Nam
if (!sc.function)
continue;
- DeclContext *function_ctx = sc.function->GetClangDeclContext();
-
- if (!function_ctx)
+ CompilerDeclContext function_decl_ctx = sc.function->GetDeclContext();
+ if (!function_decl_ctx)
continue;
- ObjCMethodDecl *method_decl = dyn_cast<ObjCMethodDecl>(function_ctx);
+ ObjCMethodDecl *method_decl = ClangASTContext::DeclContextGetAsObjCMethodDecl(function_decl_ctx);
if (!method_decl)
continue;
@@ -1772,7 +1771,7 @@ ClangASTSource::CompleteNamespaceMap (Cl
log->Printf("CompleteNamespaceMap[%u] on (ASTContext*)%p Searching for namespace %s in namespace %s",
current_id, static_cast<void*>(m_ast_context),
name.GetCString(),
- parent_map->begin()->second.GetNamespaceDecl()->getDeclName().getAsString().c_str());
+ parent_map->begin()->second.GetName().AsCString());
else
log->Printf("CompleteNamespaceMap[%u] on (ASTContext*)%p Searching for namespace %s",
current_id, static_cast<void*>(m_ast_context),
@@ -1785,10 +1784,10 @@ ClangASTSource::CompleteNamespaceMap (Cl
i != e;
++i)
{
- ClangNamespaceDecl found_namespace_decl;
+ CompilerDeclContext found_namespace_decl;
lldb::ModuleSP module_sp = i->first;
- ClangNamespaceDecl module_parent_namespace_decl = i->second;
+ CompilerDeclContext module_parent_namespace_decl = i->second;
SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
@@ -1802,7 +1801,7 @@ ClangASTSource::CompleteNamespaceMap (Cl
if (!found_namespace_decl)
continue;
- namespace_map->push_back(std::pair<lldb::ModuleSP, ClangNamespaceDecl>(module_sp, found_namespace_decl));
+ namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(module_sp, found_namespace_decl));
if (log)
log->Printf(" CMN[%u] Found namespace %s in module %s",
@@ -1816,7 +1815,7 @@ ClangASTSource::CompleteNamespaceMap (Cl
const ModuleList &target_images = m_target->GetImages();
Mutex::Locker modules_locker(target_images.GetMutex());
- ClangNamespaceDecl null_namespace_decl;
+ CompilerDeclContext null_namespace_decl;
for (size_t i = 0, e = target_images.GetSize(); i < e; ++i)
{
@@ -1825,7 +1824,7 @@ ClangASTSource::CompleteNamespaceMap (Cl
if (!image)
continue;
- ClangNamespaceDecl found_namespace_decl;
+ CompilerDeclContext found_namespace_decl;
SymbolVendor *symbol_vendor = image->GetSymbolVendor();
@@ -1839,7 +1838,7 @@ ClangASTSource::CompleteNamespaceMap (Cl
if (!found_namespace_decl)
continue;
- namespace_map->push_back(std::pair<lldb::ModuleSP, ClangNamespaceDecl>(image, found_namespace_decl));
+ namespace_map->push_back(std::pair<lldb::ModuleSP, CompilerDeclContext>(image, found_namespace_decl));
if (log)
log->Printf(" CMN[%u] Found namespace %s in module %s",
@@ -1854,19 +1853,27 @@ NamespaceDecl *
ClangASTSource::AddNamespace (NameSearchContext &context, ClangASTImporter::NamespaceMapSP &namespace_decls)
{
if (!namespace_decls)
- return NULL;
+ return nullptr;
+
+ const CompilerDeclContext &namespace_decl = namespace_decls->begin()->second;
- const ClangNamespaceDecl &namespace_decl = namespace_decls->begin()->second;
+ clang::ASTContext *src_ast = ClangASTContext::DeclContextGetClangASTContext(namespace_decl);
+ if (!src_ast)
+ return nullptr;
+ clang::NamespaceDecl *src_namespace_decl = ClangASTContext::DeclContextGetAsNamespaceDecl(namespace_decl);
- Decl *copied_decl = m_ast_importer->CopyDecl(m_ast_context, namespace_decl.GetASTContext(), namespace_decl.GetNamespaceDecl());
+ if (!src_namespace_decl)
+ return nullptr;
+
+ Decl *copied_decl = m_ast_importer->CopyDecl(m_ast_context, src_ast, src_namespace_decl);
if (!copied_decl)
- return NULL;
+ return nullptr;
NamespaceDecl *copied_namespace_decl = dyn_cast<NamespaceDecl>(copied_decl);
if (!copied_namespace_decl)
- return NULL;
+ return nullptr;
context.m_decls.push_back(copied_namespace_decl);
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Mon Aug 24 18:46:31 2015
@@ -28,7 +28,7 @@
#include "lldb/Expression/Materializer.h"
#include "lldb/Host/Endian.h"
#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
+#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -863,7 +863,7 @@ ClangExpressionDeclMap::FindGlobalVariab
Target &target,
ModuleSP &module,
const ConstString &name,
- ClangNamespaceDecl *namespace_decl,
+ CompilerDeclContext *namespace_decl,
TypeFromUser *type
)
{
@@ -882,7 +882,7 @@ ClangExpressionDeclMap::FindGlobalVariab
{
VariableSP var_sp = vars.GetVariableAtIndex(i);
- if (ClangASTContext::AreTypesSame(*type, var_sp->GetType()->GetClangFullType()))
+ if (ClangASTContext::AreTypesSame(*type, var_sp->GetType()->GetFullCompilerType ()))
return var_sp;
}
}
@@ -947,7 +947,7 @@ ClangExpressionDeclMap::FindExternalVisi
if (log)
log->Printf(" CEDM::FEVD[%u] Searching namespace %s in module %s",
current_id,
- i->second.GetNamespaceDecl()->getNameAsString().c_str(),
+ i->second.GetName().AsCString(),
i->first->GetFileSpec().GetFilename().GetCString());
FindExternalVisibleDecls(context,
@@ -958,7 +958,7 @@ ClangExpressionDeclMap::FindExternalVisi
}
else if (isa<TranslationUnitDecl>(context.m_decl_context))
{
- ClangNamespaceDecl namespace_decl;
+ CompilerDeclContext namespace_decl;
if (log)
log->Printf(" CEDM::FEVD[%u] Searching the root namespace", current_id);
@@ -976,7 +976,7 @@ ClangExpressionDeclMap::FindExternalVisi
void
ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
lldb::ModuleSP module_sp,
- ClangNamespaceDecl &namespace_decl,
+ CompilerDeclContext &namespace_decl,
unsigned int current_id)
{
assert (m_ast_context);
@@ -1013,23 +1013,20 @@ ClangExpressionDeclMap::FindExternalVisi
if (frame == NULL)
return;
- SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction);
+ SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction|lldb::eSymbolContextBlock);
- if (!sym_ctx.function)
- return;
-
- // Get the block that defines the function
+ // Find the block that defines the function represented by "sym_ctx"
Block *function_block = sym_ctx.GetFunctionBlock();
if (!function_block)
return;
- clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+ CompilerDeclContext function_decl_ctx = function_block->GetDeclContext();
- if (!decl_context)
+ if (!function_decl_ctx)
return;
- clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_context);
+ clang::CXXMethodDecl *method_decl = ClangASTContext::DeclContextGetAsCXXMethodDecl(function_decl_ctx);
if (method_decl)
{
@@ -1103,13 +1100,13 @@ ClangExpressionDeclMap::FindExternalVisi
if (!this_type)
return;
- CompilerType pointee_type = this_type->GetClangForwardType().GetPointeeType();
+ CompilerType pointee_type = this_type->GetForwardCompilerType ().GetPointeeType();
if (pointee_type.IsValid())
{
if (log)
{
- ASTDumper ast_dumper(this_type->GetClangFullType());
+ ASTDumper ast_dumper(this_type->GetFullCompilerType ());
log->Printf(" FEVD[%u] Adding type for $__lldb_objc_class: %s", current_id, ast_dumper.GetCString());
}
@@ -1117,7 +1114,7 @@ ClangExpressionDeclMap::FindExternalVisi
AddOneType(context, class_user_type, current_id);
- TypeFromUser this_user_type(this_type->GetClangFullType());
+ TypeFromUser this_user_type(this_type->GetFullCompilerType ());
m_struct_vars->m_object_pointer_type = this_user_type;
return;
}
@@ -1135,23 +1132,20 @@ ClangExpressionDeclMap::FindExternalVisi
if (!frame)
return;
- SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction);
+ SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction|lldb::eSymbolContextBlock);
- if (!sym_ctx.function)
- return;
-
- // Get the block that defines the function
+ // Find the block that defines the function represented by "sym_ctx"
Block *function_block = sym_ctx.GetFunctionBlock();
if (!function_block)
return;
- clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+ CompilerDeclContext function_decl_ctx = function_block->GetDeclContext();
- if (!decl_context)
+ if (!function_decl_ctx)
return;
- clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_context);
+ clang::ObjCMethodDecl *method_decl = ClangASTContext::DeclContextGetAsObjCMethodDecl(function_decl_ctx);
if (method_decl)
{
@@ -1220,7 +1214,7 @@ ClangExpressionDeclMap::FindExternalVisi
if (!self_type)
return;
- CompilerType self_clang_type = self_type->GetClangFullType();
+ CompilerType self_clang_type = self_type->GetFullCompilerType ();
if (ClangASTContext::IsObjCClassType(self_clang_type))
{
@@ -1235,7 +1229,7 @@ ClangExpressionDeclMap::FindExternalVisi
if (log)
{
- ASTDumper ast_dumper(self_type->GetClangFullType());
+ ASTDumper ast_dumper(self_type->GetFullCompilerType ());
log->Printf(" FEVD[%u] Adding type for $__lldb_objc_class: %s", current_id, ast_dumper.GetCString());
}
@@ -1243,7 +1237,7 @@ ClangExpressionDeclMap::FindExternalVisi
AddOneType(context, class_user_type, current_id);
- TypeFromUser self_user_type(self_type->GetClangFullType());
+ TypeFromUser self_user_type(self_type->GetFullCompilerType ());
m_struct_vars->m_object_pointer_type = self_user_type;
return;
@@ -1416,15 +1410,13 @@ ClangExpressionDeclMap::FindExternalVisi
if (sym_ctx.function)
{
- clang::DeclContext *decl_ctx = sym_ctx.function->GetClangDeclContext();
+ CompilerDeclContext decl_ctx = sym_ctx.function->GetDeclContext();
if (!decl_ctx)
continue;
// Filter out class/instance methods.
- if (dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
- continue;
- if (dyn_cast<clang::CXXMethodDecl>(decl_ctx))
+ if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
continue;
AddOneFunction(context, sym_ctx.function, NULL, current_id);
@@ -1632,7 +1624,7 @@ ClangExpressionDeclMap::GetVariableValue
return false;
}
- CompilerType var_clang_type = var_type->GetClangFullType();
+ CompilerType var_clang_type = var_type->GetFullCompilerType ();
if (!var_clang_type)
{
@@ -1687,7 +1679,7 @@ ClangExpressionDeclMap::GetVariableValue
*parser_type = TypeFromParser(type_to_use);
if (var_location.GetContextType() == Value::eContextTypeInvalid)
- var_location.SetClangType(type_to_use);
+ var_location.SetCompilerType(type_to_use);
if (var_location.GetValueType() == Value::eValueTypeFileAddress)
{
@@ -1844,7 +1836,7 @@ ClangExpressionDeclMap::AddOneGenericVar
lldb::addr_t symbol_load_addr = symbol_address.GetLoadAddress(target);
//parser_vars->m_lldb_value.SetContext(Value::eContextTypeClangType, user_type.GetOpaqueQualType());
- parser_vars->m_lldb_value.SetClangType(user_type);
+ parser_vars->m_lldb_value.SetCompilerType(user_type);
parser_vars->m_lldb_value.GetScalar() = symbol_load_addr;
parser_vars->m_lldb_value.SetValueType(Value::eValueTypeLoadAddress);
@@ -1911,10 +1903,10 @@ ClangExpressionDeclMap::ResolveUnknownTy
TypeFromUser user_type(copied_type, scratch_ast_context);
// parser_vars->m_lldb_value.SetContext(Value::eContextTypeClangType, user_type.GetOpaqueQualType());
- parser_vars->m_lldb_value.SetClangType(user_type);
+ parser_vars->m_lldb_value.SetCompilerType(user_type);
parser_vars->m_parser_type = parser_type;
- entity->SetClangType(user_type);
+ entity->SetCompilerType(user_type);
entity->m_flags &= ~(ClangExpressionVariable::EVUnknownType);
}
@@ -1995,7 +1987,7 @@ ClangExpressionDeclMap::AddOneFunction (
return;
}
- function_clang_type = function_type->GetClangFullType();
+ function_clang_type = function_type->GetFullCompilerType ();
if (!function_clang_type)
{
@@ -2060,7 +2052,7 @@ ClangExpressionDeclMap::AddOneFunction (
std::string decl_name(context.m_decl_name.getAsString());
entity->SetName(ConstString(decl_name.c_str()));
- entity->SetClangType (function_clang_type);
+ entity->SetCompilerType (function_clang_type);
entity->EnableParserVars(GetParserID());
ClangExpressionVariable::ParserVars *parser_vars = entity->GetParserVars(GetParserID());
Modified: lldb/trunk/source/Expression/ClangExpressionVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionVariable.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionVariable.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionVariable.cpp Mon Aug 24 18:46:31 2015
@@ -81,22 +81,22 @@ ClangExpressionVariable::SetRegisterInfo
}
CompilerType
-ClangExpressionVariable::GetClangType()
+ClangExpressionVariable::GetCompilerType()
{
- return m_frozen_sp->GetClangType();
+ return m_frozen_sp->GetCompilerType();
}
void
-ClangExpressionVariable::SetClangType(const CompilerType &clang_type)
+ClangExpressionVariable::SetCompilerType(const CompilerType &clang_type)
{
- m_frozen_sp->GetValue().SetClangType(clang_type);
+ m_frozen_sp->GetValue().SetCompilerType(clang_type);
}
TypeFromUser
ClangExpressionVariable::GetTypeFromUser()
{
- TypeFromUser tfu (m_frozen_sp->GetClangType());
+ TypeFromUser tfu (m_frozen_sp->GetCompilerType());
return tfu;
}
Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Mon Aug 24 18:46:31 2015
@@ -100,7 +100,7 @@ ClangFunction::ClangFunction
assert (m_jit_process_wp.lock());
m_function_addr = m_function_ptr->GetAddressRange().GetBaseAddress();
- m_function_return_type = m_function_ptr->GetClangType().GetFunctionReturnType();
+ m_function_return_type = m_function_ptr->GetCompilerType().GetFunctionReturnType();
}
//----------------------------------------------------------------------
@@ -154,7 +154,7 @@ ClangFunction::CompileFunction (Stream &
CompilerType function_clang_type;
if (m_function_ptr)
{
- function_clang_type = m_function_ptr->GetClangType();
+ function_clang_type = m_function_ptr->GetCompilerType();
if (function_clang_type)
{
int num_func_args = function_clang_type.GetFunctionArgumentCount();
@@ -181,7 +181,7 @@ ClangFunction::CompileFunction (Stream &
}
else
{
- CompilerType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType ();
+ CompilerType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetCompilerType ();
if (clang_qual_type)
{
type_name = clang_qual_type.GetTypeName().AsCString("");
@@ -391,7 +391,7 @@ ClangFunction::WriteFunctionArguments (E
if (arg_value->GetValueType() == Value::eValueTypeHostAddress &&
arg_value->GetContextType() == Value::eContextTypeInvalid &&
- arg_value->GetClangType().IsPointerType())
+ arg_value->GetCompilerType().IsPointerType())
continue;
const Scalar &arg_scalar = arg_value->ResolveValue(&exe_ctx);
@@ -486,7 +486,7 @@ ClangFunction::FetchFunctionResults (Exe
if (error.Fail())
return false;
- ret_value.SetClangType(m_function_return_type);
+ ret_value.SetCompilerType(m_function_return_type);
ret_value.SetValueType(Value::eValueTypeScalar);
return true;
}
Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Mon Aug 24 18:46:31 2015
@@ -160,7 +160,7 @@ ClangUserExpression::ScanContext(Executi
return;
}
- clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+ CompilerDeclContext decl_context = function_block->GetDeclContext();
if (!decl_context)
{
@@ -169,7 +169,7 @@ ClangUserExpression::ScanContext(Executi
return;
}
- if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_context))
+ if (clang::CXXMethodDecl *method_decl = ClangASTContext::DeclContextGetAsCXXMethodDecl(decl_context))
{
if (m_allow_cxx && method_decl->isInstance())
{
@@ -200,7 +200,7 @@ ClangUserExpression::ScanContext(Executi
m_needs_object_ptr = true;
}
}
- else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_context))
+ else if (clang::ObjCMethodDecl *method_decl = ClangASTContext::DeclContextGetAsObjCMethodDecl(decl_context))
{
if (m_allow_objc)
{
@@ -234,14 +234,14 @@ ClangUserExpression::ScanContext(Executi
m_in_static_method = true;
}
}
- else if (clang::FunctionDecl *function_decl = llvm::dyn_cast<clang::FunctionDecl>(decl_context))
+ else if (clang::FunctionDecl *function_decl = ClangASTContext::DeclContextGetAsFunctionDecl(decl_context))
{
// We might also have a function that said in the debug information that it captured an
// object pointer. The best way to deal with getting to the ivars at present is by pretending
// 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(), function_decl);
+ ClangASTMetadata *metadata = ClangASTContext::DeclContextGetMetaData (decl_context, function_decl);
if (metadata && metadata->HasObjectPtr())
{
lldb::LanguageType language = metadata->GetObjectPtrLanguage();
@@ -305,7 +305,7 @@ ClangUserExpression::ScanContext(Executi
return;
}
- CompilerType self_clang_type = self_type->GetClangForwardType();
+ CompilerType self_clang_type = self_type->GetForwardCompilerType ();
if (!self_clang_type)
{
Modified: lldb/trunk/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Expression/Materializer.cpp (original)
+++ lldb/trunk/source/Expression/Materializer.cpp Mon Aug 24 18:46:31 2015
@@ -416,7 +416,7 @@ public:
// Hard-coding to maximum size of a pointer since all variables are materialized by reference
m_size = 8;
m_alignment = 8;
- m_is_reference = m_variable_sp->GetType()->GetClangForwardType().IsReferenceType();
+ m_is_reference = m_variable_sp->GetType()->GetForwardCompilerType ().IsReferenceType();
}
void Materialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb::addr_t process_address, Error &err)
@@ -525,7 +525,7 @@ public:
return;
}
- size_t bit_align = m_variable_sp->GetType()->GetClangLayoutType().GetTypeBitAlign();
+ size_t bit_align = m_variable_sp->GetType()->GetLayoutCompilerType ().GetTypeBitAlign();
size_t byte_align = (bit_align + 7) / 8;
if (!byte_align)
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Mon Aug 24 18:46:31 2015
@@ -333,7 +333,7 @@ ABIMacOSX_arm::GetArgumentValues (Thread
if (!value)
return false;
- CompilerType clang_type = value->GetClangType();
+ CompilerType clang_type = value->GetCompilerType();
if (clang_type)
{
bool is_signed = false;
@@ -430,7 +430,7 @@ ABIMacOSX_arm::GetReturnValueObjectImpl
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType());
- value.SetClangType (clang_type);
+ value.SetCompilerType (clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
@@ -511,7 +511,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Mon Aug 24 18:46:31 2015
@@ -322,7 +322,7 @@ ABIMacOSX_arm64::GetArgumentValues (Thre
if (!value)
return false;
- CompilerType value_type = value->GetClangType();
+ CompilerType value_type = value->GetCompilerType();
if (value_type)
{
bool is_signed = false;
@@ -424,7 +424,7 @@ ABIMacOSX_arm64::SetReturnValueObject(ll
return error;
}
- CompilerType return_value_type = new_value_sp->GetClangType();
+ CompilerType return_value_type = new_value_sp->GetCompilerType();
if (!return_value_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -728,14 +728,12 @@ LoadValueFromConsecutiveGPRRegisters (Ex
const uint32_t homogeneous_count = value_type.IsHomogeneousAggregate (&base_type);
if (homogeneous_count > 0 && homogeneous_count <= 8)
{
- printf ("ClangASTContext::IsHomogeneousAggregate() => %u\n", homogeneous_count);
// Make sure we have enough registers
if (NSRN < 8 && (8-NSRN) >= homogeneous_count)
{
if (!base_type)
return false;
const size_t base_byte_size = base_type.GetByteSize(nullptr);
- printf ("ClangASTContext::IsHomogeneousAggregate() => base_byte_size = %" PRIu64 "\n", (uint64_t) base_byte_size);
uint32_t data_offset = 0;
for (uint32_t i=0; i<homogeneous_count; ++i)
@@ -871,7 +869,7 @@ ABIMacOSX_arm64::GetReturnValueObjectImp
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, return_clang_type);
- value.SetClangType(return_clang_type);
+ value.SetCompilerType(return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Mon Aug 24 18:46:31 2015
@@ -418,7 +418,7 @@ ABIMacOSX_i386::PrepareNormalCall (Threa
break;
case Value::eValueTypeHostAddress:
{
- CompilerType clang_type (val->GetClangType());
+ CompilerType clang_type (val->GetCompilerType());
if (clang_type)
{
uint32_t cstr_length = 0;
@@ -545,7 +545,7 @@ ABIMacOSX_i386::GetArgumentValues (Threa
// We currently only support extracting values with Clang QualTypes.
// Do we care about others?
- CompilerType clang_type (value->GetClangType());
+ CompilerType clang_type (value->GetCompilerType());
if (clang_type)
{
bool is_signed;
@@ -582,7 +582,7 @@ ABIMacOSX_i386::SetReturnValueObject(lld
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -663,7 +663,7 @@ ABIMacOSX_i386::GetReturnValueObjectImpl
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType());
- value.SetClangType (clang_type);
+ value.SetCompilerType (clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp Mon Aug 24 18:46:31 2015
@@ -333,7 +333,7 @@ ABISysV_arm::GetArgumentValues (Thread &
if (!value)
return false;
- CompilerType clang_type = value->GetClangType();
+ CompilerType clang_type = value->GetCompilerType();
if (clang_type)
{
bool is_signed = false;
@@ -426,7 +426,7 @@ ABISysV_arm::GetReturnValueObjectImpl (T
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType());
- value.SetClangType (clang_type);
+ value.SetCompilerType (clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
@@ -579,7 +579,7 @@ ABISysV_arm::SetReturnValueObject(lldb::
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
Modified: lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp Mon Aug 24 18:46:31 2015
@@ -313,7 +313,7 @@ ABISysV_arm64::GetArgumentValues (Thread
if (!value)
return false;
- CompilerType value_type = value->GetClangType();
+ CompilerType value_type = value->GetCompilerType();
if (value_type)
{
bool is_signed = false;
@@ -397,7 +397,7 @@ ABISysV_arm64::SetReturnValueObject(lldb
return error;
}
- CompilerType return_value_type = new_value_sp->GetClangType();
+ CompilerType return_value_type = new_value_sp->GetCompilerType();
if (!return_value_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -705,14 +705,12 @@ LoadValueFromConsecutiveGPRRegisters (Ex
const uint32_t homogeneous_count = value_type.IsHomogeneousAggregate (&base_type);
if (homogeneous_count > 0 && homogeneous_count <= 8)
{
- printf ("ClangASTContext::IsHomogeneousAggregate() => %u\n", homogeneous_count);
// Make sure we have enough registers
if (NSRN < 8 && (8-NSRN) >= homogeneous_count)
{
if (!base_type)
return false;
const size_t base_byte_size = base_type.GetByteSize(nullptr);
- printf ("ClangASTContext::IsHomogeneousAggregate() => base_byte_size = %" PRIu64 "\n", (uint64_t) base_byte_size);
uint32_t data_offset = 0;
for (uint32_t i=0; i<homogeneous_count; ++i)
@@ -841,7 +839,7 @@ ABISysV_arm64::GetReturnValueObjectImpl
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, return_clang_type);
- value.SetClangType(return_clang_type);
+ value.SetCompilerType(return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp Mon Aug 24 18:46:31 2015
@@ -387,7 +387,7 @@ ABISysV_i386::GetArgumentValues (Thread
return false;
// Currently: Support for extracting values with Clang QualTypes only.
- CompilerType clang_type (value->GetClangType());
+ CompilerType clang_type (value->GetCompilerType());
if (clang_type)
{
bool is_signed;
@@ -434,7 +434,7 @@ ABISysV_i386::GetReturnValueObjectSimple
if (!return_clang_type)
return return_valobj_sp;
- value.SetClangType (return_clang_type);
+ value.SetCompilerType (return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp Mon Aug 24 18:46:31 2015
@@ -325,7 +325,7 @@ ABISysV_mips::SetReturnValueObject(lldb:
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -417,7 +417,7 @@ ABISysV_mips::GetReturnValueObjectImpl (
if (exe_ctx.GetTargetPtr() == NULL || exe_ctx.GetProcessPtr() == NULL)
return return_valobj_sp;
- value.SetClangType(return_clang_type);
+ value.SetCompilerType(return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp Mon Aug 24 18:46:31 2015
@@ -290,7 +290,7 @@ ABISysV_mips64::SetReturnValueObject(lld
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -385,7 +385,7 @@ ABISysV_mips64::GetReturnValueObjectImpl
if (exe_ctx.GetTargetPtr() == NULL || exe_ctx.GetProcessPtr() == NULL)
return return_valobj_sp;
- value.SetClangType(return_clang_type);
+ value.SetCompilerType(return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp Mon Aug 24 18:46:31 2015
@@ -436,7 +436,7 @@ ABISysV_ppc::GetArgumentValues (Thread &
// We currently only support extracting values with Clang QualTypes.
// Do we care about others?
- CompilerType clang_type = value->GetClangType();
+ CompilerType clang_type = value->GetCompilerType();
if (!clang_type)
return false;
bool is_signed;
@@ -476,7 +476,7 @@ ABISysV_ppc::SetReturnValueObject(lldb::
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -563,7 +563,7 @@ ABISysV_ppc::SetReturnValueObject(lldb::
ValueObjectSP
ABISysV_ppc::GetReturnValueObjectSimple (Thread &thread,
- CompilerType &return_clang_type) const
+ CompilerType &return_clang_type) const
{
ValueObjectSP return_valobj_sp;
Value value;
@@ -572,7 +572,7 @@ ABISysV_ppc::GetReturnValueObjectSimple
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, return_value_type);
- value.SetClangType (return_clang_type);
+ value.SetCompilerType (return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp Mon Aug 24 18:46:31 2015
@@ -436,7 +436,7 @@ ABISysV_ppc64::GetArgumentValues (Thread
// We currently only support extracting values with Clang QualTypes.
// Do we care about others?
- CompilerType clang_type = value->GetClangType();
+ CompilerType clang_type = value->GetCompilerType();
if (!clang_type)
return false;
bool is_signed;
@@ -476,7 +476,7 @@ ABISysV_ppc64::SetReturnValueObject(lldb
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -563,7 +563,7 @@ ABISysV_ppc64::SetReturnValueObject(lldb
ValueObjectSP
ABISysV_ppc64::GetReturnValueObjectSimple (Thread &thread,
- CompilerType &return_clang_type) const
+ CompilerType &return_clang_type) const
{
ValueObjectSP return_valobj_sp;
Value value;
@@ -572,7 +572,7 @@ ABISysV_ppc64::GetReturnValueObjectSimpl
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, return_value_type);
- value.SetClangType (return_clang_type);
+ value.SetCompilerType (return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Aug 24 18:46:31 2015
@@ -502,7 +502,7 @@ ABISysV_x86_64::GetArgumentValues (Threa
// We currently only support extracting values with Clang QualTypes.
// Do we care about others?
- CompilerType clang_type = value->GetClangType();
+ CompilerType clang_type = value->GetCompilerType();
if (!clang_type)
return false;
bool is_signed;
@@ -542,7 +542,7 @@ ABISysV_x86_64::SetReturnValueObject(lld
return error;
}
- CompilerType clang_type = new_value_sp->GetClangType();
+ CompilerType clang_type = new_value_sp->GetCompilerType();
if (!clang_type)
{
error.SetErrorString ("Null clang type for return value.");
@@ -642,7 +642,7 @@ ABISysV_x86_64::GetReturnValueObjectSimp
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, return_value_type);
- value.SetClangType (return_clang_type);
+ value.SetCompilerType (return_clang_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Mon Aug 24 18:46:31 2015
@@ -630,11 +630,11 @@ DynamicLoaderMacOSXDYLD::NotifyBreakpoin
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
CompilerType clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32);
input_value.SetValueType (Value::eValueTypeScalar);
- input_value.SetClangType (clang_uint32_type);
+ input_value.SetCompilerType (clang_uint32_type);
// input_value.SetContext (Value::eContextTypeClangType, clang_uint32_type);
argument_values.PushValue (input_value);
argument_values.PushValue (input_value);
- input_value.SetClangType (clang_void_ptr_type);
+ input_value.SetCompilerType (clang_void_ptr_type);
// input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type);
argument_values.PushValue (input_value);
Modified: lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Mon Aug 24 18:46:31 2015
@@ -40,7 +40,7 @@ ItaniumABILanguageRuntime::CouldHaveDyna
{
const bool check_cxx = true;
const bool check_objc = false;
- return in_value.GetClangType().IsPossibleDynamicType (NULL, check_cxx, check_objc);
+ return in_value.GetCompilerType().IsPossibleDynamicType (NULL, check_cxx, check_objc);
}
bool
@@ -189,7 +189,7 @@ ItaniumABILanguageRuntime::GetDynamicTyp
type_sp = class_types.GetTypeAtIndex(i);
if (type_sp)
{
- if (ClangASTContext::IsCXXClassType(type_sp->GetClangFullType()))
+ if (ClangASTContext::IsCXXClassType(type_sp->GetFullCompilerType ()))
{
if (log)
log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types, picking this one: uid={0x%" PRIx64 "}, type-name='%s'\n",
@@ -221,8 +221,8 @@ ItaniumABILanguageRuntime::GetDynamicTyp
// the value we were handed.
if (type_sp)
{
- if (ClangASTContext::AreTypesSame (in_value.GetClangType(),
- type_sp->GetClangFullType()))
+ if (ClangASTContext::AreTypesSame (in_value.GetCompilerType(),
+ type_sp->GetFullCompilerType ()))
{
// The dynamic type we found was the same type,
// so we don't have a dynamic type here...
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Mon Aug 24 18:46:31 2015
@@ -51,7 +51,7 @@ AppleObjCRuntime::AppleObjCRuntime(Proce
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{
- CompilerType clang_type(valobj.GetClangType());
+ CompilerType clang_type(valobj.GetCompilerType());
bool is_signed;
// ObjC objects can only be pointers (or numbers that actually represents pointers
// but haven't been typecast, because reasons..)
@@ -89,7 +89,7 @@ AppleObjCRuntime::GetObjectDescription (
return false;
Target *target = exe_ctx.GetTargetPtr();
- CompilerType clang_type = value.GetClangType();
+ CompilerType clang_type = value.GetCompilerType();
if (clang_type)
{
if (!ClangASTContext::IsObjCObjectPointerType(clang_type))
@@ -106,7 +106,7 @@ AppleObjCRuntime::GetObjectDescription (
if (!opaque_type)
opaque_type = ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
//value.SetContext(Value::eContextTypeClangType, opaque_type_ptr);
- value.SetClangType (opaque_type);
+ value.SetCompilerType (opaque_type);
}
ValueList arg_value_list;
@@ -118,7 +118,7 @@ AppleObjCRuntime::GetObjectDescription (
CompilerType return_clang_type = ast_context->GetCStringType(true);
Value ret;
// ret.SetContext(Value::eContextTypeClangType, return_clang_type);
- ret.SetClangType (return_clang_type);
+ ret.SetCompilerType (return_clang_type);
if (exe_ctx.GetFramePtr() == NULL)
{
@@ -229,7 +229,7 @@ AppleObjCRuntime::GetPrintForDebuggerAdd
bool
AppleObjCRuntime::CouldHaveDynamicValue (ValueObject &in_value)
{
- return in_value.GetClangType().IsPossibleDynamicType (NULL,
+ return in_value.GetCompilerType().IsPossibleDynamicType (NULL,
false, // do not check C++
true); // check ObjC
}
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Mon Aug 24 18:46:31 2015
@@ -1139,7 +1139,7 @@ AppleObjCRuntimeV2::GetClassDescriptor (
// if we get an invalid VO (which might still happen when playing around
// with pointers returned by the expression parser, don't consider this
// a valid ObjC object)
- if (valobj.GetClangType().IsValid())
+ if (valobj.GetCompilerType().IsValid())
{
addr_t isa_pointer = valobj.GetPointerValue();
@@ -1276,13 +1276,13 @@ AppleObjCRuntimeV2::UpdateISAToDescripto
Value value;
value.SetValueType (Value::eValueTypeScalar);
// value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type);
- value.SetClangType (clang_void_pointer_type);
+ value.SetCompilerType (clang_void_pointer_type);
arguments.PushValue (value);
arguments.PushValue (value);
value.SetValueType (Value::eValueTypeScalar);
// value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type);
- value.SetClangType (clang_uint32_t_type);
+ value.SetCompilerType (clang_uint32_t_type);
arguments.PushValue (value);
m_get_class_info_function.reset(new ClangFunction (*m_process,
@@ -1355,7 +1355,7 @@ AppleObjCRuntimeV2::UpdateISAToDescripto
Value return_value;
return_value.SetValueType (Value::eValueTypeScalar);
//return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type);
- return_value.SetClangType (clang_uint32_t_type);
+ return_value.SetCompilerType (clang_uint32_t_type);
return_value.GetScalar() = 0;
errors.Clear();
@@ -1530,13 +1530,13 @@ AppleObjCRuntimeV2::UpdateISAToDescripto
Value value;
value.SetValueType (Value::eValueTypeScalar);
//value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type);
- value.SetClangType (clang_void_pointer_type);
+ value.SetCompilerType (clang_void_pointer_type);
arguments.PushValue (value);
arguments.PushValue (value);
value.SetValueType (Value::eValueTypeScalar);
//value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type);
- value.SetClangType (clang_uint32_t_type);
+ value.SetCompilerType (clang_uint32_t_type);
arguments.PushValue (value);
m_get_shared_cache_class_info_function.reset(new ClangFunction (*m_process,
@@ -1610,7 +1610,7 @@ AppleObjCRuntimeV2::UpdateISAToDescripto
Value return_value;
return_value.SetValueType (Value::eValueTypeScalar);
//return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type);
- return_value.SetClangType (clang_uint32_t_type);
+ return_value.SetCompilerType (clang_uint32_t_type);
return_value.GetScalar() = 0;
errors.Clear();
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Mon Aug 24 18:46:31 2015
@@ -526,7 +526,7 @@ AppleObjCTrampolineHandler::AppleObjCVTa
input_value.SetValueType (Value::eValueTypeScalar);
//input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type);
- input_value.SetClangType (clang_void_ptr_type);
+ input_value.SetCompilerType (clang_void_ptr_type);
argument_values.PushValue(input_value);
bool success = abi->GetArgumentValues (exe_ctx.GetThreadRef(), argument_values);
@@ -901,7 +901,7 @@ AppleObjCTrampolineHandler::GetStepThrou
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
void_ptr_value.SetValueType (Value::eValueTypeScalar);
//void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type);
- void_ptr_value.SetClangType (clang_void_ptr_type);
+ void_ptr_value.SetCompilerType (clang_void_ptr_type);
int obj_index;
int sel_index;
@@ -1083,7 +1083,7 @@ AppleObjCTrampolineHandler::GetStepThrou
CompilerType clang_int_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32);
flag_value.SetValueType (Value::eValueTypeScalar);
//flag_value.SetContext (Value::eContextTypeClangType, clang_int_type);
- flag_value.SetClangType (clang_int_type);
+ flag_value.SetCompilerType (clang_int_type);
if (this_dispatch.stret_return)
flag_value.GetScalar() = 1;
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Aug 24 18:46:31 2015
@@ -26,7 +26,6 @@
#include "lldb/Core/UUID.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/FileSpec.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/MemoryRegionInfo.h"
Modified: lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp (original)
+++ lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp Mon Aug 24 18:46:31 2015
@@ -24,7 +24,6 @@
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h Mon Aug 24 18:46:31 2015
@@ -85,7 +85,6 @@ public:
dw_attr_t attr;
dw_form_t form;
};
-
typedef llvm::SmallVector<Info, 8> collection;
collection m_infos;
};
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=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Aug 24 18:46:31 2015
@@ -461,7 +461,7 @@ SymbolFileDWARF::GetTypes (SymbolContext
size_t num_types_added = 0;
for (Type *type : type_set)
{
- CompilerType clang_type = type->GetClangForwardType();
+ CompilerType clang_type = type->GetForwardCompilerType ();
if (clang_type_set.find(clang_type) == clang_type_set.end())
{
clang_type_set.insert(clang_type);
@@ -1432,8 +1432,8 @@ SymbolFileDWARF::ClassOrStructIsVirtual
return false;
}
-clang::DeclContext*
-SymbolFileDWARF::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid)
+CompilerDeclContext
+SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid)
{
if (UserIDMatches(type_uid))
{
@@ -1446,15 +1446,15 @@ SymbolFileDWARF::GetClangDeclContextCont
{
TypeSystem *type_system = GetTypeSystemForLanguage(cu_sp->GetLanguageType());
if (type_system)
- return type_system->GetClangDeclContextContainingTypeUID(this, type_uid);
+ return type_system->GetDeclContextForUIDFromDWARF(this, cu_sp.get(), die);
}
}
}
- return NULL;
+ return CompilerDeclContext();
}
-clang::DeclContext*
-SymbolFileDWARF::GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid)
+CompilerDeclContext
+SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid)
{
if (UserIDMatches(type_uid))
{
@@ -1467,13 +1467,14 @@ SymbolFileDWARF::GetClangDeclContextForT
{
TypeSystem *type_system = GetTypeSystemForLanguage(cu_sp->GetLanguageType());
if (type_system)
- return type_system->GetClangDeclContextForTypeUID(this, sc, type_uid);
+ return type_system->GetDeclContextContainingUIDFromDWARF(this, cu_sp.get(), die);
}
}
}
- return NULL;
+ return CompilerDeclContext();
}
+
Type*
SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid)
{
@@ -1537,7 +1538,7 @@ SymbolFileDWARF::ResolveTypeUID (DWARFCo
// // want a function (method or static) from a class, the class must
// // create itself and add it's own methods and class functions.
// if (parent_type)
-// parent_type->GetClangFullType();
+// parent_type->GetFullCompilerType ();
// }
}
break;
@@ -2134,24 +2135,18 @@ SymbolFileDWARF::Index ()
}
bool
-SymbolFileDWARF::NamespaceDeclMatchesThisSymbolFile (const ClangNamespaceDecl *namespace_decl)
+SymbolFileDWARF::DeclContextMatchesThisSymbolFile (const lldb_private::CompilerDeclContext *decl_ctx)
{
- if (namespace_decl == NULL)
+ if (decl_ctx == nullptr || !decl_ctx->IsValid())
{
// Invalid namespace decl which means we aren't matching only things
// in this symbol file, so return true to indicate it matches this
// symbol file.
return true;
}
-
- clang::ASTContext *namespace_ast = namespace_decl->GetASTContext();
-
- if (namespace_ast == NULL)
- return true; // No AST in the "namespace_decl", return true since it
- // could then match any symbol file, including this one
- if (namespace_ast == GetClangASTContext().getASTContext())
- return true; // The ASTs match, return true
+ if ((TypeSystem *)&GetClangASTContext() == decl_ctx->GetTypeSystem())
+ return true; // The type systems match, return true
// The namespace AST was valid, and it does not match...
Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
@@ -2163,18 +2158,18 @@ SymbolFileDWARF::NamespaceDeclMatchesThi
}
uint32_t
-SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+SymbolFileDWARF::FindGlobalVariables (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, VariableList& variables)
{
Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
if (log)
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", namespace_decl=%p, append=%u, max_matches=%u, variables)",
+ "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", parent_decl_ctx=%p, append=%u, max_matches=%u, variables)",
name.GetCString(),
- static_cast<const void*>(namespace_decl),
+ static_cast<const void*>(parent_decl_ctx),
append, max_matches);
- if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl))
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
return 0;
DWARFDebugInfo* info = DebugInfo();
@@ -2245,12 +2240,16 @@ SymbolFileDWARF::FindGlobalVariables (co
{
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, UINT32_MAX);
- if (namespace_decl)
+ if (parent_decl_ctx)
{
TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
- if (!type_system->DIEIsInNamespace (namespace_decl, this, dwarf_cu, die))
- continue;
+ if (type_system)
+ {
+ CompilerDeclContext actual_parent_decl_ctx = type_system->GetDeclContextContainingUIDFromDWARF (this, dwarf_cu, die);
+ if (!actual_parent_decl_ctx || actual_parent_decl_ctx != *parent_decl_ctx)
+ continue;
+ }
}
ParseVariables(sc, dwarf_cu, LLDB_INVALID_ADDRESS, die, false, false, &variables);
@@ -2277,9 +2276,9 @@ SymbolFileDWARF::FindGlobalVariables (co
if (log && num_matches > 0)
{
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", namespace_decl=%p, append=%u, max_matches=%u, variables) => %u",
+ "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", parent_decl_ctx=%p, append=%u, max_matches=%u, variables) => %u",
name.GetCString(),
- static_cast<const void*>(namespace_decl),
+ static_cast<const void*>(parent_decl_ctx),
append, max_matches,
num_matches);
}
@@ -2614,9 +2613,34 @@ SymbolFileDWARF::FunctionDieMatchesParti
return true;
}
+bool
+SymbolFileDWARF::DIEInDeclContext (const CompilerDeclContext *decl_ctx,
+ DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry *die)
+{
+ // If we have no parent decl context to match this DIE matches, and if the parent
+ // decl context isn't valid, we aren't trying to look for any particular decl
+ // context so any die matches.
+ if (decl_ctx == nullptr || !decl_ctx->IsValid())
+ return true;
+
+ if (cu && die)
+ {
+ TypeSystem *type_system = GetTypeSystemForLanguage(cu->GetLanguageType());
+
+ if (type_system)
+ {
+ CompilerDeclContext actual_decl_ctx = type_system->GetDeclContextContainingUIDFromDWARF (this, cu, die);
+ if (actual_decl_ctx)
+ return actual_decl_ctx == *decl_ctx;
+ }
+ }
+ return false;
+}
+
uint32_t
-SymbolFileDWARF::FindFunctions (const ConstString &name,
- const lldb_private::ClangNamespaceDecl *namespace_decl,
+SymbolFileDWARF::FindFunctions (const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
uint32_t name_type_mask,
bool include_inlines,
bool append,
@@ -2644,7 +2668,7 @@ SymbolFileDWARF::FindFunctions (const Co
if (!append)
sc_list.Clear();
- if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl))
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
return 0;
// If name is empty then we won't find anything.
@@ -2685,13 +2709,8 @@ SymbolFileDWARF::FindFunctions (const Co
const DWARFDebugInfoEntry *die = info->GetDIEPtrWithCompileUnitHint (die_offset, &dwarf_cu);
if (die)
{
- if (namespace_decl)
- {
- TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
-
- if (!type_system->DIEIsInNamespace (namespace_decl, this, dwarf_cu, die))
- continue;
- }
+ if (!DIEInDeclContext(parent_decl_ctx, dwarf_cu, die))
+ continue; // The containing decl contexts don't match
if (resolved_dies.find(die) == resolved_dies.end())
{
@@ -2709,7 +2728,7 @@ SymbolFileDWARF::FindFunctions (const Co
if (name_type_mask & eFunctionNameTypeSelector)
{
- if (namespace_decl && *namespace_decl)
+ if (parent_decl_ctx && parent_decl_ctx->IsValid())
return 0; // no selectors in namespaces
num_matches = m_apple_names_ap->FindByName (name_cstr, die_offsets);
@@ -2741,7 +2760,7 @@ SymbolFileDWARF::FindFunctions (const Co
die_offsets.clear();
}
- if (((name_type_mask & eFunctionNameTypeMethod) && !namespace_decl) || name_type_mask & eFunctionNameTypeBase)
+ if (((name_type_mask & eFunctionNameTypeMethod) && !parent_decl_ctx) || name_type_mask & eFunctionNameTypeBase)
{
// The apple_names table stores just the "base name" of C++ methods in the table. So we have to
// extract the base name, look that up, and if there is any other information in the name we were
@@ -2756,13 +2775,9 @@ SymbolFileDWARF::FindFunctions (const Co
const DWARFDebugInfoEntry* die = info->GetDIEPtrWithCompileUnitHint (die_offset, &dwarf_cu);
if (die)
{
- if (namespace_decl)
- {
- TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
+ if (!DIEInDeclContext(parent_decl_ctx, dwarf_cu, die))
+ continue; // The containing decl contexts don't match
- if (!type_system->DIEIsInNamespace (namespace_decl, this, dwarf_cu, die))
- continue;
- }
// If we get to here, the die is good, and we should add it:
if (resolved_dies.find(die) == resolved_dies.end())
@@ -2786,8 +2801,8 @@ SymbolFileDWARF::FindFunctions (const Co
if (type)
{
- clang::DeclContext* decl_ctx = GetClangDeclContextContainingTypeUID (type->GetID());
- if (decl_ctx->isRecord())
+ CompilerDeclContext decl_ctx = GetDeclContextContainingUID (type->GetID());
+ if (decl_ctx.IsStructUnionOrClass())
{
if (name_type_mask & eFunctionNameTypeBase)
{
@@ -2849,7 +2864,7 @@ SymbolFileDWARF::FindFunctions (const Co
if (sc_list.GetSize() == 0)
{
ArchSpec arch;
- if (!namespace_decl &&
+ if (!parent_decl_ctx &&
GetObjectFile()->GetArchitecture(arch) &&
(arch.GetTriple().isOSFreeBSD() || arch.GetTriple().isOSLinux() ||
arch.GetMachine() == llvm::Triple::hexagon))
@@ -2886,13 +2901,8 @@ SymbolFileDWARF::FindFunctions (const Co
const DWARFDebugInfoEntry* die = info->GetDIEPtrWithCompileUnitHint (die_offsets[i], &dwarf_cu);
if (die)
{
- if (namespace_decl)
- {
- TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
-
- if (!type_system->DIEIsInNamespace (namespace_decl, this, dwarf_cu, die))
- continue;
- }
+ if (!DIEInDeclContext(parent_decl_ctx, dwarf_cu, die))
+ continue; // The containing decl contexts don't match
// If we get to here, the die is good, and we should add it:
if (resolved_dies.find(die) == resolved_dies.end())
@@ -2907,7 +2917,7 @@ SymbolFileDWARF::FindFunctions (const Co
if (name_type_mask & eFunctionNameTypeMethod)
{
- if (namespace_decl && *namespace_decl)
+ if (parent_decl_ctx && parent_decl_ctx->IsValid())
return 0; // no methods in namespaces
uint32_t num_base = m_function_method_index.Find(name, die_offsets);
@@ -2929,7 +2939,7 @@ SymbolFileDWARF::FindFunctions (const Co
die_offsets.clear();
}
- if ((name_type_mask & eFunctionNameTypeSelector) && (!namespace_decl || !*namespace_decl))
+ if ((name_type_mask & eFunctionNameTypeSelector) && (!parent_decl_ctx || !parent_decl_ctx->IsValid()))
{
FindFunctions (name, m_function_selector_index, include_inlines, sc_list);
}
@@ -3001,7 +3011,7 @@ SymbolFileDWARF::FindFunctions(const Reg
uint32_t
SymbolFileDWARF::FindTypes (const SymbolContext& sc,
const ConstString &name,
- const lldb_private::ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
bool append,
uint32_t max_matches,
TypeList& types)
@@ -3014,16 +3024,16 @@ SymbolFileDWARF::FindTypes (const Symbol
if (log)
{
- if (namespace_decl)
+ if (parent_decl_ctx)
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(%p) \"%s\", append=%u, max_matches=%u, type_list)",
+ "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = %p (\"%s\"), append=%u, max_matches=%u, type_list)",
name.GetCString(),
- static_cast<void*>(namespace_decl->GetNamespaceDecl()),
- namespace_decl->GetQualifiedName().c_str(),
+ static_cast<const void*>(parent_decl_ctx),
+ parent_decl_ctx->GetName().AsCString("<NULL>"),
append, max_matches);
else
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(NULL), append=%u, max_matches=%u, type_list)",
+ "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = NULL, append=%u, max_matches=%u, type_list)",
name.GetCString(), append,
max_matches);
}
@@ -3032,7 +3042,7 @@ SymbolFileDWARF::FindTypes (const Symbol
if (!append)
types.Clear();
- if (!NamespaceDeclMatchesThisSymbolFile(namespace_decl))
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
return 0;
DIEArray die_offsets;
@@ -3068,13 +3078,8 @@ SymbolFileDWARF::FindTypes (const Symbol
if (die)
{
- if (namespace_decl)
- {
- TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
-
- if (!type_system->DIEIsInNamespace (namespace_decl, this, dwarf_cu, die))
- continue;
- }
+ if (!DIEInDeclContext(parent_decl_ctx, dwarf_cu, die))
+ continue; // The containing decl contexts don't match
Type *matching_type = ResolveType (dwarf_cu, die);
if (matching_type)
@@ -3098,20 +3103,20 @@ SymbolFileDWARF::FindTypes (const Symbol
const uint32_t num_matches = types.GetSize() - initial_types_size;
if (log && num_matches)
{
- if (namespace_decl)
+ if (parent_decl_ctx)
{
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(%p) \"%s\", append=%u, max_matches=%u, type_list) => %u",
+ "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = %p (\"%s\"), append=%u, max_matches=%u, type_list) => %u",
name.GetCString(),
- static_cast<void*>(namespace_decl->GetNamespaceDecl()),
- namespace_decl->GetQualifiedName().c_str(),
+ static_cast<const void*>(parent_decl_ctx),
+ parent_decl_ctx->GetName().AsCString("<NULL>"),
append, max_matches,
num_matches);
}
else
{
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindTypes (sc, name=\"%s\", clang::NamespaceDecl(NULL), append=%u, max_matches=%u, type_list) => %u",
+ "SymbolFileDWARF::FindTypes (sc, name=\"%s\", parent_decl_ctx = NULL, append=%u, max_matches=%u, type_list) => %u",
name.GetCString(),
append, max_matches,
num_matches);
@@ -3123,10 +3128,10 @@ SymbolFileDWARF::FindTypes (const Symbol
}
-ClangNamespaceDecl
+CompilerDeclContext
SymbolFileDWARF::FindNamespace (const SymbolContext& sc,
const ConstString &name,
- const lldb_private::ClangNamespaceDecl *parent_namespace_decl)
+ const CompilerDeclContext *parent_decl_ctx)
{
Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
@@ -3136,11 +3141,13 @@ SymbolFileDWARF::FindNamespace (const Sy
"SymbolFileDWARF::FindNamespace (sc, name=\"%s\")",
name.GetCString());
}
-
- if (!NamespaceDeclMatchesThisSymbolFile(parent_namespace_decl))
- return ClangNamespaceDecl();
- ClangNamespaceDecl namespace_decl;
+ CompilerDeclContext namespace_decl_ctx;
+
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
+ return namespace_decl_ctx;
+
+
DWARFDebugInfo* info = DebugInfo();
if (info)
{
@@ -3177,23 +3184,16 @@ SymbolFileDWARF::FindNamespace (const Sy
if (die)
{
- TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
+ if (!DIEInDeclContext(parent_decl_ctx, dwarf_cu, die))
+ continue; // The containing decl contexts don't match
- if (parent_namespace_decl)
- {
- if (type_system && !type_system->DIEIsInNamespace (parent_namespace_decl, this, dwarf_cu, die))
- continue;
- }
+ TypeSystem *type_system = GetTypeSystemForLanguage(dwarf_cu->GetLanguageType());
if (type_system)
{
- clang::NamespaceDecl *clang_namespace_decl = type_system->ResolveNamespaceDIE (this, dwarf_cu, die);
- if (clang_namespace_decl)
- {
- namespace_decl.SetASTContext (GetClangASTContext().getASTContext());
- namespace_decl.SetNamespaceDecl (clang_namespace_decl);
+ namespace_decl_ctx = type_system->GetDeclContextForUIDFromDWARF(this, dwarf_cu, die);
+ if (namespace_decl_ctx)
break;
- }
}
}
else
@@ -3208,16 +3208,17 @@ SymbolFileDWARF::FindNamespace (const Sy
}
}
}
- if (log && namespace_decl.GetNamespaceDecl())
+ if (log && namespace_decl_ctx)
{
GetObjectFile()->GetModule()->LogMessage (log,
- "SymbolFileDWARF::FindNamespace (sc, name=\"%s\") => clang::NamespaceDecl(%p) \"%s\"",
+ "SymbolFileDWARF::FindNamespace (sc, name=\"%s\") => CompilerDeclContext(%p/%p) \"%s\"",
name.GetCString(),
- static_cast<const void*>(namespace_decl.GetNamespaceDecl()),
- namespace_decl.GetQualifiedName().c_str());
+ static_cast<const void*>(namespace_decl_ctx.GetTypeSystem()),
+ static_cast<const void*>(namespace_decl_ctx.GetOpaqueDeclContext()),
+ namespace_decl_ctx.GetName().AsCString("<NULL>"));
}
- return namespace_decl;
+ return namespace_decl_ctx;
}
uint32_t
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Mon Aug 24 18:46:31 2015
@@ -90,62 +90,145 @@ public:
static lldb_private::SymbolFile*
CreateInstance (lldb_private::ObjectFile* obj_file);
+
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
- SymbolFileDWARF(lldb_private::ObjectFile* ofile);
- ~SymbolFileDWARF() override;
- uint32_t CalculateAbilities () override;
- void InitializeObject() override;
+ SymbolFileDWARF(lldb_private::ObjectFile* ofile);
+
+ ~SymbolFileDWARF() override;
+
+ uint32_t
+ CalculateAbilities () override;
+
+ void
+ InitializeObject() override;
//------------------------------------------------------------------
// Compile Unit function calls
//------------------------------------------------------------------
- uint32_t GetNumCompileUnits() override;
- lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
- lldb::LanguageType ParseCompileUnitLanguage (const lldb_private::SymbolContext& sc) override;
- size_t ParseCompileUnitFunctions (const lldb_private::SymbolContext& sc) override;
- bool ParseCompileUnitLineTable (const lldb_private::SymbolContext& sc) override;
- bool ParseCompileUnitSupportFiles (const lldb_private::SymbolContext& sc, lldb_private::FileSpecList& support_files) override;
- bool ParseImportedModules (const lldb_private::SymbolContext &sc, std::vector<lldb_private::ConstString> &imported_modules) override;
- size_t ParseFunctionBlocks (const lldb_private::SymbolContext& sc) override;
- size_t ParseTypes (const lldb_private::SymbolContext& sc) override;
- size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc) override;
-
- lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid) override;
- bool CompleteType (lldb_private::CompilerType& clang_type) override;
-
- lldb_private::Type* ResolveType (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* type_die, bool assert_not_being_parsed = true);
- lldb_private::Type* GetCachedTypeForDIE (const DWARFDebugInfoEntry* type_die) const;
- void ClearDIEBeingParsed (const DWARFDebugInfoEntry* type_die);
- clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) override;
- clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) override;
-
- uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc) override;
- uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list) override;
- uint32_t FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
- uint32_t FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
- uint32_t FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
- uint32_t FindFunctions(const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
- uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types) override;
+ uint32_t
+ GetNumCompileUnits() override;
+
+ lldb::CompUnitSP
+ ParseCompileUnitAtIndex(uint32_t index) override;
+
+ lldb::LanguageType
+ ParseCompileUnitLanguage (const lldb_private::SymbolContext& sc) override;
+
+ size_t
+ ParseCompileUnitFunctions (const lldb_private::SymbolContext& sc) override;
+
+ bool
+ ParseCompileUnitLineTable (const lldb_private::SymbolContext& sc) override;
+
+ bool
+ ParseCompileUnitSupportFiles (const lldb_private::SymbolContext& sc,
+ lldb_private::FileSpecList& support_files) override;
+
+ bool
+ ParseImportedModules (const lldb_private::SymbolContext &sc,
+ std::vector<lldb_private::ConstString> &imported_modules) override;
+
+ size_t
+ ParseFunctionBlocks (const lldb_private::SymbolContext& sc) override;
+
+ size_t
+ ParseTypes (const lldb_private::SymbolContext& sc) override;
+
+ size_t
+ ParseVariablesForContext (const lldb_private::SymbolContext& sc) override;
+
+ lldb_private::Type *
+ ResolveTypeUID(lldb::user_id_t type_uid) override;
+
+ bool
+ CompleteType (lldb_private::CompilerType& clang_type) override;
+
+ lldb_private::Type *
+ ResolveType (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry* type_die,
+ bool assert_not_being_parsed = true);
+
+ lldb_private::Type *
+ GetCachedTypeForDIE (const DWARFDebugInfoEntry* type_die) const;
+
+ void
+ ClearDIEBeingParsed (const DWARFDebugInfoEntry* type_die);
+
+ lldb_private::CompilerDeclContext
+ GetDeclContextForUID (lldb::user_id_t uid) override;
+
+ lldb_private::CompilerDeclContext
+ GetDeclContextContainingUID (lldb::user_id_t uid) override;
+
+ uint32_t
+ ResolveSymbolContext (const lldb_private::Address& so_addr,
+ uint32_t resolve_scope,
+ lldb_private::SymbolContext& sc) override;
+
+ uint32_t
+ ResolveSymbolContext (const lldb_private::FileSpec& file_spec,
+ uint32_t line,
+ bool check_inlines,
+ uint32_t resolve_scope,
+ lldb_private::SymbolContextList& sc_list) override;
+
+ uint32_t
+ FindGlobalVariables (const lldb_private::ConstString &name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ bool append,
+ uint32_t max_matches,
+ lldb_private::VariableList& variables) override;
+
+ uint32_t
+ FindGlobalVariables (const lldb_private::RegularExpression& regex,
+ bool append,
+ uint32_t max_matches,
+ lldb_private::VariableList& variables) override;
+
+ uint32_t
+ FindFunctions (const lldb_private::ConstString &name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ uint32_t name_type_mask,
+ bool include_inlines,
+ bool append,
+ lldb_private::SymbolContextList& sc_list) override;
+
+ uint32_t
+ FindFunctions (const lldb_private::RegularExpression& regex,
+ bool include_inlines,
+ bool append,
+ lldb_private::SymbolContextList& sc_list) override;
+
+ uint32_t
+ FindTypes (const lldb_private::SymbolContext& sc,
+ const lldb_private::ConstString &name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ bool append,
+ uint32_t max_matches,
+ lldb_private::TypeList& types) override;
+
lldb_private::TypeList *
- GetTypeList () override;
- size_t GetTypes (lldb_private::SymbolContextScope *sc_scope,
- uint32_t type_mask,
- lldb_private::TypeList &type_list) override;
+ GetTypeList () override;
+
+ size_t
+ GetTypes (lldb_private::SymbolContextScope *sc_scope,
+ uint32_t type_mask,
+ lldb_private::TypeList &type_list) override;
lldb_private::ClangASTContext &
- GetClangASTContext () override;
+ GetClangASTContext () override;
lldb_private::TypeSystem *
- GetTypeSystemForLanguage (lldb::LanguageType language) override;
+ GetTypeSystemForLanguage (lldb::LanguageType language) override;
- lldb_private::ClangNamespaceDecl
- FindNamespace (const lldb_private::SymbolContext& sc,
- const lldb_private::ConstString &name,
- const lldb_private::ClangNamespaceDecl *parent_namespace_decl) override;
+ lldb_private::CompilerDeclContext
+ FindNamespace (const lldb_private::SymbolContext& sc,
+ const lldb_private::ConstString &name,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx) override;
//------------------------------------------------------------------
@@ -171,14 +254,22 @@ public:
const lldb_private::DWARFDataExtractor& get_apple_objc_data ();
- DWARFDebugAbbrev* DebugAbbrev();
- const DWARFDebugAbbrev* DebugAbbrev() const;
+ DWARFDebugAbbrev*
+ DebugAbbrev();
+
+ const DWARFDebugAbbrev*
+ DebugAbbrev() const;
- DWARFDebugInfo* DebugInfo();
- const DWARFDebugInfo* DebugInfo() const;
+ DWARFDebugInfo*
+ DebugInfo();
- DWARFDebugRanges* DebugRanges();
- const DWARFDebugRanges* DebugRanges() const;
+ const DWARFDebugInfo*
+ DebugInfo() const;
+
+ DWARFDebugRanges*
+ DebugRanges();
+ const DWARFDebugRanges*
+ DebugRanges() const;
const lldb_private::DWARFDataExtractor&
GetCachedSectionData (uint32_t got_flag,
@@ -189,7 +280,8 @@ public:
SupportedVersion(uint16_t version);
const DWARFDebugInfoEntry *
- GetDeclContextDIEContainingDIE (const DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die);
+ GetDeclContextDIEContainingDIE (const DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry *die);
lldb_private::Flags&
GetFlags ()
@@ -207,7 +299,8 @@ public:
HasForwardDeclForClangType (const lldb_private::CompilerType &clang_type);
lldb_private::CompileUnit*
- GetCompUnitForDWARFCompUnit(DWARFCompileUnit* dwarf_cu, uint32_t cu_idx = UINT32_MAX);
+ GetCompUnitForDWARFCompUnit(DWARFCompileUnit* dwarf_cu,
+ uint32_t cu_idx = UINT32_MAX);
lldb::user_id_t
MakeUserID (dw_offset_t die_offset) const
@@ -216,7 +309,8 @@ public:
}
size_t
- GetObjCMethodDIEOffsets (lldb_private::ConstString class_name, DIEArray &method_die_offsets);
+ GetObjCMethodDIEOffsets (lldb_private::ConstString class_name,
+ DIEArray &method_die_offsets);
bool
Supports_DW_AT_APPLE_objc_complete_type (DWARFCompileUnit *cu);
@@ -245,123 +339,174 @@ protected:
flagsGotAppleObjCData = (1 << 14)
};
- bool NamespaceDeclMatchesThisSymbolFile (const lldb_private::ClangNamespaceDecl *namespace_decl);
+ bool
+ DeclContextMatchesThisSymbolFile (const lldb_private::CompilerDeclContext *decl_ctx);
+
+ bool
+ DIEInDeclContext (const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry *die);
DISALLOW_COPY_AND_ASSIGN (SymbolFileDWARF);
- lldb::CompUnitSP ParseCompileUnit (DWARFCompileUnit* dwarf_cu, uint32_t cu_idx);
- DWARFCompileUnit* GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit);
- DWARFCompileUnit* GetNextUnparsedDWARFCompileUnit(DWARFCompileUnit* prev_cu);
- bool GetFunction (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* func_die, lldb_private::SymbolContext& sc);
- lldb_private::Function * ParseCompileUnitFunction (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die);
- size_t ParseFunctionBlocks (const lldb_private::SymbolContext& sc,
- lldb_private::Block *parent_block,
- DWARFCompileUnit* dwarf_cu,
- const DWARFDebugInfoEntry *die,
- lldb::addr_t subprogram_low_pc,
- uint32_t depth);
- size_t ParseTypes (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool parse_siblings, bool parse_children);
- lldb::TypeSP ParseType (const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new);
- lldb_private::Type* ResolveTypeUID (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* die, bool assert_not_being_parsed);
-
- lldb::VariableSP ParseVariableDIE(
- const lldb_private::SymbolContext& sc,
- DWARFCompileUnit* dwarf_cu,
- const DWARFDebugInfoEntry *die,
- const lldb::addr_t func_low_pc);
-
- size_t ParseVariables(
- const lldb_private::SymbolContext& sc,
- DWARFCompileUnit* dwarf_cu,
- const lldb::addr_t func_low_pc,
- const DWARFDebugInfoEntry *die,
- bool parse_siblings,
- bool parse_children,
- lldb_private::VariableList* cc_variable_list = NULL);
-
- bool ClassOrStructIsVirtual (
- DWARFCompileUnit* dwarf_cu,
- const DWARFDebugInfoEntry *parent_die);
-
- // Given a die_offset, figure out the symbol context representing that die.
- bool ResolveFunction (dw_offset_t offset,
- DWARFCompileUnit *&dwarf_cu,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
-
- bool ResolveFunction (DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry *die,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
-
- bool FunctionDieMatchesPartialName (
- const DWARFDebugInfoEntry* die,
- const DWARFCompileUnit *dwarf_cu,
- uint32_t name_type_mask,
- const char *partial_name,
- const char *base_name_start,
- const char *base_name_end);
-
- void FindFunctions(
- const lldb_private::ConstString &name,
- const NameToDIE &name_to_die,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
-
- void FindFunctions (
- const lldb_private::RegularExpression ®ex,
- const NameToDIE &name_to_die,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
-
- void FindFunctions (
- const lldb_private::RegularExpression ®ex,
- const DWARFMappedHash::MemoryTable &memory_table,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
-
- lldb::TypeSP FindDefinitionTypeForDWARFDeclContext (
- const DWARFDeclContext &die_decl_ctx);
-
- lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE (
- const DWARFDebugInfoEntry *die,
- const lldb_private::ConstString &type_name,
- bool must_be_implementation);
-
- lldb::TypeSP FindCompleteObjCDefinitionType (const lldb_private::ConstString &type_name,
- bool header_definition_ok);
-
- lldb_private::Symbol * GetObjCClassSymbol (const lldb_private::ConstString &objc_class_name);
-
- void ParseFunctions (const DIEArray &die_offsets,
- bool include_inlines,
- lldb_private::SymbolContextList& sc_list);
- lldb::TypeSP GetTypeForDIE (DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry* die);
- uint32_t FindTypes(std::vector<dw_offset_t> die_offsets, uint32_t max_matches, lldb_private::TypeList& types);
+ lldb::CompUnitSP
+ ParseCompileUnit (DWARFCompileUnit* dwarf_cu,
+ uint32_t cu_idx);
- void Index();
-
- void DumpIndexes();
+ DWARFCompileUnit*
+ GetDWARFCompileUnit (lldb_private::CompileUnit *comp_unit);
+
+ DWARFCompileUnit*
+ GetNextUnparsedDWARFCompileUnit (DWARFCompileUnit* prev_cu);
+
+ bool
+ GetFunction (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry* func_die,
+ lldb_private::SymbolContext& sc);
+
+ lldb_private::Function *
+ ParseCompileUnitFunction (const lldb_private::SymbolContext& sc,
+ DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die);
+
+ size_t
+ ParseFunctionBlocks (const lldb_private::SymbolContext& sc,
+ lldb_private::Block *parent_block,
+ DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die,
+ lldb::addr_t subprogram_low_pc,
+ uint32_t depth);
+
+ size_t
+ ParseTypes (const lldb_private::SymbolContext& sc,
+ DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die,
+ bool parse_siblings,
+ bool parse_children);
+
+ lldb::TypeSP
+ ParseType (const lldb_private::SymbolContext& sc,
+ DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die,
+ bool *type_is_new);
+
+ lldb_private::Type *
+ ResolveTypeUID (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry* die,
+ bool assert_not_being_parsed);
+
+ lldb::VariableSP
+ ParseVariableDIE(const lldb_private::SymbolContext& sc,
+ DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die,
+ const lldb::addr_t func_low_pc);
+
+ size_t
+ ParseVariables(const lldb_private::SymbolContext& sc,
+ DWARFCompileUnit* dwarf_cu,
+ const lldb::addr_t func_low_pc,
+ const DWARFDebugInfoEntry *die,
+ bool parse_siblings,
+ bool parse_children,
+ lldb_private::VariableList* cc_variable_list = NULL);
- void SetDebugMapModule (const lldb::ModuleSP &module_sp)
- {
- m_debug_map_module_wp = module_sp;
- }
+ bool
+ ClassOrStructIsVirtual (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *parent_die);
+
+ // Given a die_offset, figure out the symbol context representing that die.
+ bool
+ ResolveFunction (dw_offset_t offset,
+ DWARFCompileUnit *&dwarf_cu,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ bool
+ ResolveFunction (DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry *die,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ bool
+ FunctionDieMatchesPartialName (const DWARFDebugInfoEntry* die,
+ const DWARFCompileUnit *dwarf_cu,
+ uint32_t name_type_mask,
+ const char *partial_name,
+ const char *base_name_start,
+ const char *base_name_end);
+
+ void
+ FindFunctions(const lldb_private::ConstString &name,
+ const NameToDIE &name_to_die,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ void
+ FindFunctions (const lldb_private::RegularExpression ®ex,
+ const NameToDIE &name_to_die,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ void
+ FindFunctions (const lldb_private::RegularExpression ®ex,
+ const DWARFMappedHash::MemoryTable &memory_table,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ lldb::TypeSP
+ FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &die_decl_ctx);
+
+ lldb::TypeSP
+ FindCompleteObjCDefinitionTypeForDIE (const DWARFDebugInfoEntry *die,
+ const lldb_private::ConstString &type_name,
+ bool must_be_implementation);
+
+ lldb::TypeSP
+ FindCompleteObjCDefinitionType (const lldb_private::ConstString &type_name,
+ bool header_definition_ok);
+
+ lldb_private::Symbol *
+ GetObjCClassSymbol (const lldb_private::ConstString &objc_class_name);
+
+ void
+ ParseFunctions (const DIEArray &die_offsets,
+ bool include_inlines,
+ lldb_private::SymbolContextList& sc_list);
+
+ lldb::TypeSP
+ GetTypeForDIE (DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry* die);
+
+ uint32_t
+ FindTypes (std::vector<dw_offset_t> die_offsets,
+ uint32_t max_matches,
+ lldb_private::TypeList& types);
+
+ void
+ Index();
+ void
+ DumpIndexes();
+
+ void
+ SetDebugMapModule (const lldb::ModuleSP &module_sp)
+ {
+ m_debug_map_module_wp = module_sp;
+ }
+
SymbolFileDWARFDebugMap *
- GetDebugMapSymfile ();
+ GetDebugMapSymfile ();
const DWARFDebugInfoEntry *
- FindBlockContainingSpecification (dw_offset_t func_die_offset,
- dw_offset_t spec_block_die_offset,
- DWARFCompileUnit **dwarf_cu_handle);
+ FindBlockContainingSpecification (dw_offset_t func_die_offset,
+ dw_offset_t spec_block_die_offset,
+ DWARFCompileUnit **dwarf_cu_handle);
const DWARFDebugInfoEntry *
- FindBlockContainingSpecification (DWARFCompileUnit* dwarf_cu,
- const DWARFDebugInfoEntry *die,
- dw_offset_t spec_block_die_offset,
- DWARFCompileUnit **dwarf_cu_handle);
+ FindBlockContainingSpecification (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *die,
+ dw_offset_t spec_block_die_offset,
+ DWARFCompileUnit **dwarf_cu_handle);
UniqueDWARFASTTypeMap &
GetUniqueDWARFASTTypeMap ();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Mon Aug 24 18:46:31 2015
@@ -877,7 +877,7 @@ uint32_t
SymbolFileDWARFDebugMap::PrivateFindGlobalVariables
(
const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
+ const CompilerDeclContext *parent_decl_ctx,
const std::vector<uint32_t> &indexes, // Indexes into the symbol table that match "name"
uint32_t max_matches,
VariableList& variables
@@ -894,7 +894,7 @@ SymbolFileDWARFDebugMap::PrivateFindGlob
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx);
if (oso_dwarf)
{
- if (oso_dwarf->FindGlobalVariables(name, namespace_decl, true, max_matches, variables))
+ if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, true, max_matches, variables))
if (variables.GetSize() > max_matches)
break;
}
@@ -904,7 +904,11 @@ SymbolFileDWARFDebugMap::PrivateFindGlob
}
uint32_t
-SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ bool append,
+ uint32_t max_matches,
+ VariableList& variables)
{
// If we aren't appending the results to this list, then clear the list
@@ -919,7 +923,7 @@ SymbolFileDWARFDebugMap::FindGlobalVaria
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
const uint32_t oso_matches = oso_dwarf->FindGlobalVariables (name,
- namespace_decl,
+ parent_decl_ctx,
true,
max_matches,
variables);
@@ -1097,7 +1101,12 @@ RemoveFunctionsWithModuleNotEqualTo (con
}
uint32_t
-SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
+SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t name_type_mask,
+ bool include_inlines,
+ bool append,
+ SymbolContextList& sc_list)
{
Timer scoped_timer (__PRETTY_FUNCTION__,
"SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
@@ -1111,7 +1120,7 @@ SymbolFileDWARFDebugMap::FindFunctions(c
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
uint32_t sc_idx = sc_list.GetSize();
- if (oso_dwarf->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, true, sc_list))
+ if (oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask, include_inlines, true, sc_list))
{
RemoveFunctionsWithModuleNotEqualTo (m_obj_file->GetModule(), sc_list, sc_idx);
}
@@ -1286,8 +1295,8 @@ SymbolFileDWARFDebugMap::FindTypes
(
const SymbolContext& sc,
const ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
- bool append,
+ const CompilerDeclContext *parent_decl_ctx,
+ bool append,
uint32_t max_matches,
TypeList& types
)
@@ -1302,12 +1311,12 @@ SymbolFileDWARFDebugMap::FindTypes
{
oso_dwarf = GetSymbolFile (sc);
if (oso_dwarf)
- return oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types);
+ return oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types);
}
else
{
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
- oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types);
+ oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types);
return false;
});
}
@@ -1326,24 +1335,24 @@ SymbolFileDWARFDebugMap::FindTypes
//}
-ClangNamespaceDecl
+CompilerDeclContext
SymbolFileDWARFDebugMap::FindNamespace (const lldb_private::SymbolContext& sc,
const lldb_private::ConstString &name,
- const ClangNamespaceDecl *parent_namespace_decl)
+ const CompilerDeclContext *parent_decl_ctx)
{
- ClangNamespaceDecl matching_namespace;
+ CompilerDeclContext matching_namespace;
SymbolFileDWARF *oso_dwarf;
if (sc.comp_unit)
{
oso_dwarf = GetSymbolFile (sc);
if (oso_dwarf)
- matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl);
+ matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_decl_ctx);
}
else
{
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
- matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl);
+ matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_decl_ctx);
return (bool)matching_namespace;
});
@@ -1433,24 +1442,24 @@ SymbolFileDWARFDebugMap::SetCompileUnit
}
}
-clang::DeclContext*
-SymbolFileDWARFDebugMap::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid)
+CompilerDeclContext
+SymbolFileDWARFDebugMap::GetDeclContextForUID (lldb::user_id_t type_uid)
{
const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid);
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx);
if (oso_dwarf)
- return oso_dwarf->GetClangDeclContextContainingTypeUID (type_uid);
- return NULL;
+ return oso_dwarf->GetDeclContextForUID (type_uid);
+ return CompilerDeclContext();
}
-clang::DeclContext*
-SymbolFileDWARFDebugMap::GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid)
+CompilerDeclContext
+SymbolFileDWARFDebugMap::GetDeclContextContainingUID (lldb::user_id_t type_uid)
{
const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid);
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx);
if (oso_dwarf)
- return oso_dwarf->GetClangDeclContextForTypeUID (sc, type_uid);
- return NULL;
+ return oso_dwarf->GetDeclContextContainingUID (type_uid);
+ return CompilerDeclContext();
}
bool
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h Mon Aug 24 18:46:31 2015
@@ -75,20 +75,20 @@ public:
size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc) override;
lldb_private::Type* ResolveTypeUID (lldb::user_id_t type_uid) override;
- clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) override;
- clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) override;
+ lldb_private::CompilerDeclContext GetDeclContextForUID (lldb::user_id_t uid) override;
+ lldb_private::CompilerDeclContext GetDeclContextContainingUID (lldb::user_id_t uid) override;
bool CompleteType (lldb_private::CompilerType& clang_type) override;
uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc) override;
uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list) override;
- uint32_t FindGlobalVariables (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
+ uint32_t FindGlobalVariables (const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
uint32_t FindGlobalVariables (const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override;
- uint32_t FindFunctions (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
+ uint32_t FindFunctions (const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
uint32_t FindFunctions (const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list) override;
- uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types) override;
- lldb_private::ClangNamespaceDecl
+ uint32_t FindTypes (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, lldb_private::TypeList& types) override;
+ lldb_private::CompilerDeclContext
FindNamespace (const lldb_private::SymbolContext& sc,
const lldb_private::ConstString &name,
- const lldb_private::ClangNamespaceDecl *parent_namespace_decl) override;
+ const lldb_private::CompilerDeclContext *parent_decl_ctx) override;
size_t GetTypes (lldb_private::SymbolContextScope *sc_scope,
uint32_t type_mask,
lldb_private::TypeList &type_list) override;
@@ -244,7 +244,7 @@ protected:
uint32_t
PrivateFindGlobalVariables (const lldb_private::ConstString &name,
- const lldb_private::ClangNamespaceDecl *namespace_decl,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
const std::vector<uint32_t> &name_symbol_indexes,
uint32_t max_matches,
lldb_private::VariableList& variables);
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Mon Aug 24 18:46:31 2015
@@ -305,12 +305,6 @@ SymbolFileSymtab::CompleteType (lldb_pri
return false;
}
-ClangNamespaceDecl
-SymbolFileSymtab::FindNamespace (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl)
-{
- return ClangNamespaceDecl();
-}
-
uint32_t
SymbolFileSymtab::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc)
{
@@ -327,63 +321,6 @@ SymbolFileSymtab::ResolveSymbolContext (
return resolved_flags;
}
-uint32_t
-SymbolFileSymtab::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
-{
- return 0;
-}
-
-uint32_t
-SymbolFileSymtab::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
-{
- return 0;
-}
-
-uint32_t
-SymbolFileSymtab::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
-{
- return 0;
-}
-
-uint32_t
-SymbolFileSymtab::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
-{
- Timer scoped_timer (__PRETTY_FUNCTION__,
- "SymbolFileSymtab::FindFunctions (name = '%s')",
- name.GetCString());
- // If we ever support finding STABS or COFF debug info symbols,
- // we will need to add support here. We are not trying to find symbols
- // here, just "lldb_private::Function" objects that come from complete
- // debug information. Any symbol queries should go through the symbol
- // table itself in the module's object file.
- return 0;
-}
-
-uint32_t
-SymbolFileSymtab::FindFunctions(const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list)
-{
- Timer scoped_timer (__PRETTY_FUNCTION__,
- "SymbolFileSymtab::FindFunctions (regex = '%s')",
- regex.GetText());
- // If we ever support finding STABS or COFF debug info symbols,
- // we will need to add support here. We are not trying to find symbols
- // here, just "lldb_private::Function" objects that come from complete
- // debug information. Any symbol queries should go through the symbol
- // table itself in the module's object file.
- return 0;
-}
-
-uint32_t
-SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc,
- const lldb_private::ConstString &name,
- const ClangNamespaceDecl *namespace_decl,
- bool append,
- uint32_t max_matches,
- lldb_private::TypeList& types)
-{
- return 0;
-}
-
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h Mon Aug 24 18:46:31 2015
@@ -87,34 +87,11 @@ public:
virtual uint32_t
ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc);
- virtual uint32_t
- ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list);
-
- virtual uint32_t
- FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables);
-
- virtual uint32_t
- FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables);
-
- virtual uint32_t
- FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list);
-
- virtual uint32_t
- FindFunctions(const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list);
-
- virtual uint32_t
- FindTypes (const lldb_private::SymbolContext& sc,const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types);
-
virtual size_t
GetTypes (lldb_private::SymbolContextScope *sc_scope,
uint32_t type_mask,
lldb_private::TypeList &type_list);
- virtual lldb_private::ClangNamespaceDecl
- FindNamespace (const lldb_private::SymbolContext& sc,
- const lldb_private::ConstString &name,
- const lldb_private::ClangNamespaceDecl *parent_namespace_decl);
-
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp Mon Aug 24 18:46:31 2015
@@ -298,25 +298,25 @@ AppleGetItemInfoHandler::GetItemInfo (Th
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
Value return_buffer_ptr_value;
return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar);
- return_buffer_ptr_value.SetClangType (clang_void_ptr_type);
+ return_buffer_ptr_value.SetCompilerType (clang_void_ptr_type);
CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt);
Value debug_value;
debug_value.SetValueType (Value::eValueTypeScalar);
- debug_value.SetClangType (clang_int_type);
+ debug_value.SetCompilerType (clang_int_type);
CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong);
Value item_value;
item_value.SetValueType (Value::eValueTypeScalar);
- item_value.SetClangType (clang_uint64_type);
+ item_value.SetCompilerType (clang_uint64_type);
Value page_to_free_value;
page_to_free_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_value.SetClangType (clang_void_ptr_type);
+ page_to_free_value.SetCompilerType (clang_void_ptr_type);
Value page_to_free_size_value;
page_to_free_size_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_size_value.SetClangType (clang_uint64_type);
+ page_to_free_size_value.SetCompilerType (clang_uint64_type);
Mutex::Locker locker(m_get_item_info_retbuffer_mutex);
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp Mon Aug 24 18:46:31 2015
@@ -304,25 +304,25 @@ AppleGetPendingItemsHandler::GetPendingI
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
Value return_buffer_ptr_value;
return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar);
- return_buffer_ptr_value.SetClangType (clang_void_ptr_type);
+ return_buffer_ptr_value.SetCompilerType (clang_void_ptr_type);
CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt);
Value debug_value;
debug_value.SetValueType (Value::eValueTypeScalar);
- debug_value.SetClangType (clang_int_type);
+ debug_value.SetCompilerType (clang_int_type);
CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong);
Value queue_value;
queue_value.SetValueType (Value::eValueTypeScalar);
- queue_value.SetClangType (clang_uint64_type);
+ queue_value.SetCompilerType (clang_uint64_type);
Value page_to_free_value;
page_to_free_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_value.SetClangType (clang_void_ptr_type);
+ page_to_free_value.SetCompilerType (clang_void_ptr_type);
Value page_to_free_size_value;
page_to_free_size_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_size_value.SetClangType (clang_uint64_type);
+ page_to_free_size_value.SetCompilerType (clang_uint64_type);
Mutex::Locker locker(m_get_pending_items_retbuffer_mutex);
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp Mon Aug 24 18:46:31 2015
@@ -311,21 +311,21 @@ AppleGetQueuesHandler::GetCurrentQueues
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
Value return_buffer_ptr_value;
return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar);
- return_buffer_ptr_value.SetClangType (clang_void_ptr_type);
+ return_buffer_ptr_value.SetCompilerType (clang_void_ptr_type);
CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt);
Value debug_value;
debug_value.SetValueType (Value::eValueTypeScalar);
- debug_value.SetClangType (clang_int_type);
+ debug_value.SetCompilerType (clang_int_type);
Value page_to_free_value;
page_to_free_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_value.SetClangType (clang_void_ptr_type);
+ page_to_free_value.SetCompilerType (clang_void_ptr_type);
CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong);
Value page_to_free_size_value;
page_to_free_size_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_size_value.SetClangType (clang_uint64_type);
+ page_to_free_size_value.SetCompilerType (clang_uint64_type);
Mutex::Locker locker(m_get_queues_retbuffer_mutex);
Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp Mon Aug 24 18:46:31 2015
@@ -301,25 +301,25 @@ AppleGetThreadItemInfoHandler::GetThread
CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
Value return_buffer_ptr_value;
return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar);
- return_buffer_ptr_value.SetClangType (clang_void_ptr_type);
+ return_buffer_ptr_value.SetCompilerType (clang_void_ptr_type);
CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt);
Value debug_value;
debug_value.SetValueType (Value::eValueTypeScalar);
- debug_value.SetClangType (clang_int_type);
+ debug_value.SetCompilerType (clang_int_type);
CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong);
Value thread_id_value;
thread_id_value.SetValueType (Value::eValueTypeScalar);
- thread_id_value.SetClangType (clang_uint64_type);
+ thread_id_value.SetCompilerType (clang_uint64_type);
Value page_to_free_value;
page_to_free_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_value.SetClangType (clang_void_ptr_type);
+ page_to_free_value.SetCompilerType (clang_void_ptr_type);
Value page_to_free_size_value;
page_to_free_size_value.SetValueType (Value::eValueTypeScalar);
- page_to_free_size_value.SetClangType (clang_uint64_type);
+ page_to_free_size_value.SetCompilerType (clang_uint64_type);
Mutex::Locker locker(m_get_thread_item_info_retbuffer_mutex);
Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Mon Aug 24 18:46:31 2015
@@ -546,27 +546,24 @@ Block::AppendVariables
return num_variables_added;
}
-clang::DeclContext *
-Block::GetClangDeclContext()
+CompilerDeclContext
+Block::GetDeclContext()
{
- SymbolContext sc;
-
- CalculateSymbolContext (&sc);
-
- if (!sc.module_sp)
- return nullptr;
-
- SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
-
- if (!sym_vendor)
- return nullptr;
-
- SymbolFile *sym_file = sym_vendor->GetSymbolFile();
-
- if (!sym_file)
- return nullptr;
-
- return sym_file->GetClangDeclContextForTypeUID (sc, m_uid);
+ ModuleSP module_sp = CalculateSymbolContextModule ();
+
+ if (module_sp)
+ {
+ SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
+
+ if (sym_vendor)
+ {
+ SymbolFile *sym_file = sym_vendor->GetSymbolFile();
+
+ if (sym_file)
+ return sym_file->GetDeclContextForUID (GetID());
+ }
+ }
+ return CompilerDeclContext();
}
void
Modified: lldb/trunk/source/Symbol/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CMakeLists.txt?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CMakeLists.txt (original)
+++ lldb/trunk/source/Symbol/CMakeLists.txt Mon Aug 24 18:46:31 2015
@@ -6,7 +6,7 @@ add_lldb_library(lldbSymbol
ClangASTImporter.cpp
ClangExternalASTSourceCallbacks.cpp
ClangExternalASTSourceCommon.cpp
- ClangNamespaceDecl.cpp
+ CompilerDeclContext.cpp
CompilerType.cpp
CompileUnit.cpp
CompactUnwindInfo.cpp
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Mon Aug 24 18:46:31 2015
@@ -2188,64 +2188,6 @@ ClangASTContext::GetAsDeclContext (clang
return llvm::dyn_cast<clang::DeclContext>(objc_method_decl);
}
-
-bool
-ClangASTContext::GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
- lldb::LanguageType &language,
- bool &is_instance_method,
- ConstString &language_object_name)
-{
- language_object_name.Clear();
- language = eLanguageTypeUnknown;
- is_instance_method = false;
-
- if (decl_ctx)
- {
- if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx))
- {
- if (method_decl->isStatic())
- {
- is_instance_method = false;
- }
- else
- {
- language_object_name.SetCString("this");
- is_instance_method = true;
- }
- language = eLanguageTypeC_plus_plus;
- return true;
- }
- else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
- {
- // Both static and instance methods have a "self" object in objective C
- language_object_name.SetCString("self");
- if (method_decl->isInstanceMethod())
- {
- is_instance_method = true;
- }
- else
- {
- is_instance_method = false;
- }
- language = eLanguageTypeObjC;
- return true;
- }
- else if (clang::FunctionDecl *function_decl = llvm::dyn_cast<clang::FunctionDecl>(decl_ctx))
- {
- ClangASTMetadata *metadata = GetMetadata (&decl_ctx->getParentASTContext(), function_decl);
- if (metadata && metadata->HasObjectPtr())
- {
- language_object_name.SetCString (metadata->GetObjectPtrName());
- language = eLanguageTypeObjC;
- is_instance_method = true;
- }
- return true;
- }
- }
- return false;
-}
-
-
bool
ClangASTContext::SetTagTypeKind (clang::QualType tag_qual_type, int kind) const
{
@@ -2291,6 +2233,12 @@ ClangASTContext::SetDefaultAccessForReco
}
clang::DeclContext *
+ClangASTContext::GetDeclContextForType (const CompilerType& type)
+{
+ return GetDeclContextForType(GetQualType(type));
+}
+
+clang::DeclContext *
ClangASTContext::GetDeclContextForType (clang::QualType type)
{
if (type.isNull())
@@ -2300,24 +2248,6 @@ ClangASTContext::GetDeclContextForType (
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
- case clang::Type::UnaryTransform: break;
- case clang::Type::FunctionNoProto: break;
- case clang::Type::FunctionProto: break;
- case clang::Type::IncompleteArray: break;
- case clang::Type::VariableArray: break;
- case clang::Type::ConstantArray: break;
- case clang::Type::DependentSizedArray: break;
- case clang::Type::ExtVector: break;
- case clang::Type::DependentSizedExtVector: break;
- case clang::Type::Vector: break;
- case clang::Type::Builtin: break;
- case clang::Type::BlockPointer: break;
- case clang::Type::Pointer: break;
- case clang::Type::LValueReference: break;
- case clang::Type::RValueReference: break;
- case clang::Type::MemberPointer: break;
- case clang::Type::Complex: break;
- case clang::Type::ObjCObject: break;
case clang::Type::ObjCInterface: return llvm::cast<clang::ObjCObjectType>(qual_type.getTypePtr())->getInterface();
case clang::Type::ObjCObjectPointer: return GetDeclContextForType (llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType());
case clang::Type::Record: return llvm::cast<clang::RecordType>(qual_type)->getDecl();
@@ -2325,26 +2255,8 @@ ClangASTContext::GetDeclContextForType (
case clang::Type::Typedef: return GetDeclContextForType (llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType());
case clang::Type::Elaborated: return GetDeclContextForType (llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType());
case clang::Type::Paren: return GetDeclContextForType (llvm::cast<clang::ParenType>(qual_type)->desugar());
- case clang::Type::TypeOfExpr: break;
- case clang::Type::TypeOf: break;
- case clang::Type::Decltype: break;
- //case clang::Type::QualifiedName: break;
- case clang::Type::TemplateSpecialization: break;
- case clang::Type::DependentTemplateSpecialization: break;
- case clang::Type::TemplateTypeParm: break;
- case clang::Type::SubstTemplateTypeParm: break;
- case clang::Type::SubstTemplateTypeParmPack:break;
- case clang::Type::PackExpansion: break;
- case clang::Type::UnresolvedUsing: break;
- case clang::Type::Attributed: break;
- case clang::Type::Auto: break;
- case clang::Type::InjectedClassName: break;
- case clang::Type::DependentName: break;
- case clang::Type::Atomic: break;
- case clang::Type::Adjusted: break;
-
- // pointer type decayed from an array or function type.
- case clang::Type::Decayed: break;
+ default:
+ break;
}
// No DeclContext in this type...
return nullptr;
@@ -2517,14 +2429,14 @@ ClangASTContext::IsArrayType (void* type
case clang::Type::ConstantArray:
if (element_type_ptr)
- element_type_ptr->SetClangType (getASTContext(), llvm::cast<clang::ConstantArrayType>(qual_type)->getElementType());
+ element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::ConstantArrayType>(qual_type)->getElementType());
if (size)
*size = llvm::cast<clang::ConstantArrayType>(qual_type)->getSize().getLimitedValue(ULLONG_MAX);
return true;
case clang::Type::IncompleteArray:
if (element_type_ptr)
- element_type_ptr->SetClangType (getASTContext(), llvm::cast<clang::IncompleteArrayType>(qual_type)->getElementType());
+ element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::IncompleteArrayType>(qual_type)->getElementType());
if (size)
*size = 0;
if (is_incomplete)
@@ -2533,14 +2445,14 @@ ClangASTContext::IsArrayType (void* type
case clang::Type::VariableArray:
if (element_type_ptr)
- element_type_ptr->SetClangType (getASTContext(), llvm::cast<clang::VariableArrayType>(qual_type)->getElementType());
+ element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::VariableArrayType>(qual_type)->getElementType());
if (size)
*size = 0;
return true;
case clang::Type::DependentSizedArray:
if (element_type_ptr)
- element_type_ptr->SetClangType (getASTContext(), llvm::cast<clang::DependentSizedArrayType>(qual_type)->getElementType());
+ element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::DependentSizedArrayType>(qual_type)->getElementType());
if (size)
*size = 0;
return true;
@@ -2923,19 +2835,19 @@ ClangASTContext::IsPointerType (void* ty
return false;
case clang::Type::ObjCObjectPointer:
if (pointee_type)
- pointee_type->SetClangType (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::BlockPointer:
if (pointee_type)
- pointee_type->SetClangType (getASTContext(), llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType (getASTContext(), llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::Pointer:
if (pointee_type)
- pointee_type->SetClangType (getASTContext(), llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType (getASTContext(), llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::MemberPointer:
if (pointee_type)
- pointee_type->SetClangType (getASTContext(), llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType (getASTContext(), llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::Typedef:
return IsPointerType (llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), pointee_type);
@@ -2974,27 +2886,27 @@ ClangASTContext::IsPointerOrReferenceTyp
return false;
case clang::Type::ObjCObjectPointer:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::BlockPointer:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::Pointer:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::MemberPointer:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
return true;
case clang::Type::LValueReference:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
return true;
case clang::Type::RValueReference:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
return true;
case clang::Type::Typedef:
return IsPointerOrReferenceType(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), pointee_type);
@@ -3024,13 +2936,13 @@ ClangASTContext::IsReferenceType (void*
{
case clang::Type::LValueReference:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
if (is_rvalue)
*is_rvalue = false;
return true;
case clang::Type::RValueReference:
if (pointee_type)
- pointee_type->SetClangType(getASTContext(), llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
+ pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
if (is_rvalue)
*is_rvalue = true;
return true;
@@ -3191,7 +3103,7 @@ ClangASTContext::IsPossibleDynamicType (
if (check_objc && llvm::cast<clang::BuiltinType>(qual_type)->getKind() == clang::BuiltinType::ObjCId)
{
if (dynamic_pointee_type)
- dynamic_pointee_type->SetClangType(this, type);
+ dynamic_pointee_type->SetCompilerType(this, type);
return true;
}
break;
@@ -3200,7 +3112,7 @@ ClangASTContext::IsPossibleDynamicType (
if (check_objc)
{
if (dynamic_pointee_type)
- dynamic_pointee_type->SetClangType(getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
+ dynamic_pointee_type->SetCompilerType(getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
return true;
}
break;
@@ -3251,7 +3163,7 @@ ClangASTContext::IsPossibleDynamicType (
case clang::BuiltinType::UnknownAny:
case clang::BuiltinType::Void:
if (dynamic_pointee_type)
- dynamic_pointee_type->SetClangType(getASTContext(), pointee_qual_type);
+ dynamic_pointee_type->SetCompilerType(getASTContext(), pointee_qual_type);
return true;
case clang::BuiltinType::NullPtr:
@@ -3327,7 +3239,7 @@ ClangASTContext::IsPossibleDynamicType (
if (success)
{
if (dynamic_pointee_type)
- dynamic_pointee_type->SetClangType(getASTContext(), pointee_qual_type);
+ dynamic_pointee_type->SetCompilerType(getASTContext(), pointee_qual_type);
return true;
}
}
@@ -3339,7 +3251,7 @@ ClangASTContext::IsPossibleDynamicType (
if (check_objc)
{
if (dynamic_pointee_type)
- dynamic_pointee_type->SetClangType(getASTContext(), pointee_qual_type);
+ dynamic_pointee_type->SetCompilerType(getASTContext(), pointee_qual_type);
return true;
}
break;
@@ -3442,7 +3354,7 @@ ClangASTContext::IsObjCObjectPointerType
if (obj_pointer_type == nullptr)
class_type_ptr->Clear();
else
- class_type_ptr->SetClangType (type.GetTypeSystem(), clang::QualType(obj_pointer_type->getInterfaceType(), 0).getAsOpaquePtr());
+ class_type_ptr->SetCompilerType (type.GetTypeSystem(), clang::QualType(obj_pointer_type->getInterfaceType(), 0).getAsOpaquePtr());
}
}
return true;
@@ -3535,13 +3447,13 @@ ClangASTContext::GetTypeInfo (void* type
case clang::BuiltinType::ObjCId:
case clang::BuiltinType::ObjCClass:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), getASTContext()->ObjCBuiltinClassTy);
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), getASTContext()->ObjCBuiltinClassTy);
builtin_type_flags |= eTypeIsPointer | eTypeIsObjC;
break;
case clang::BuiltinType::ObjCSel:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), getASTContext()->CharTy);
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), getASTContext()->CharTy);
builtin_type_flags |= eTypeIsPointer | eTypeIsObjC;
break;
@@ -3585,7 +3497,7 @@ ClangASTContext::GetTypeInfo (void* type
case clang::Type::BlockPointer:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), qual_type->getPointeeType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), qual_type->getPointeeType());
return eTypeIsPointer | eTypeHasChildren | eTypeIsBlock;
case clang::Type::Complex:
@@ -3609,7 +3521,7 @@ ClangASTContext::GetTypeInfo (void* type
case clang::Type::IncompleteArray:
case clang::Type::VariableArray:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), llvm::cast<clang::ArrayType>(qual_type.getTypePtr())->getElementType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), llvm::cast<clang::ArrayType>(qual_type.getTypePtr())->getElementType());
return eTypeHasChildren | eTypeIsArray;
case clang::Type::DependentName: return 0;
@@ -3619,7 +3531,7 @@ ClangASTContext::GetTypeInfo (void* type
case clang::Type::Enum:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), llvm::cast<clang::EnumType>(qual_type)->getDecl()->getIntegerType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), llvm::cast<clang::EnumType>(qual_type)->getDecl()->getIntegerType());
return eTypeIsEnumeration | eTypeHasValue;
case clang::Type::Elaborated:
@@ -3634,14 +3546,14 @@ ClangASTContext::GetTypeInfo (void* type
case clang::Type::LValueReference:
case clang::Type::RValueReference:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), llvm::cast<clang::ReferenceType>(qual_type.getTypePtr())->getPointeeType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), llvm::cast<clang::ReferenceType>(qual_type.getTypePtr())->getPointeeType());
return eTypeHasChildren | eTypeIsReference | eTypeHasValue;
case clang::Type::MemberPointer: return eTypeIsPointer | eTypeIsMember | eTypeHasValue;
case clang::Type::ObjCObjectPointer:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), qual_type->getPointeeType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), qual_type->getPointeeType());
return eTypeHasChildren | eTypeIsObjC | eTypeIsClass | eTypeIsPointer | eTypeHasValue;
case clang::Type::ObjCObject: return eTypeHasChildren | eTypeIsObjC | eTypeIsClass;
@@ -3649,7 +3561,7 @@ ClangASTContext::GetTypeInfo (void* type
case clang::Type::Pointer:
if (pointee_or_element_clang_type)
- pointee_or_element_clang_type->SetClangType(getASTContext(), qual_type->getPointeeType());
+ pointee_or_element_clang_type->SetCompilerType(getASTContext(), qual_type->getPointeeType());
return eTypeHasChildren | eTypeIsPointer | eTypeHasValue;
case clang::Type::Record:
@@ -4224,7 +4136,7 @@ ClangASTContext::GetNonReferenceType (vo
CompilerType
ClangASTContext::CreateTypedefType (const CompilerType& type,
const char *typedef_name,
- clang::DeclContext *decl_ctx)
+ const CompilerDeclContext &compiler_decl_ctx)
{
if (type && typedef_name && typedef_name[0])
{
@@ -4233,8 +4145,11 @@ ClangASTContext::CreateTypedefType (cons
return CompilerType();
clang::ASTContext* clang_ast = ast->getASTContext();
clang::QualType qual_type (GetQualType(type));
+
+ clang::DeclContext *decl_ctx = ClangASTContext::DeclContextGetAsDeclContext(compiler_decl_ctx);
if (decl_ctx == nullptr)
decl_ctx = ast->getASTContext()->getTranslationUnitDecl();
+
clang::TypedefDecl *decl = clang::TypedefDecl::Create (*clang_ast,
decl_ctx,
clang::SourceLocation(),
@@ -4313,11 +4228,9 @@ ClangASTContext::RemoveFastQualifiers (c
//----------------------------------------------------------------------
CompilerType
-ClangASTContext::GetBasicTypeFromAST (void* type, lldb::BasicType basic_type)
+ClangASTContext::GetBasicTypeFromAST (lldb::BasicType basic_type)
{
- if (type)
- return ClangASTContext::GetBasicType(getASTContext(), basic_type);
- return CompilerType();
+ return ClangASTContext::GetBasicType(getASTContext(), basic_type);
}
//----------------------------------------------------------------------
// Exploring the type
@@ -4925,122 +4838,31 @@ ClangASTContext::GetBasicTypeEnumeration
return eBasicTypeInvalid;
}
-
-#pragma mark Aggregate Types
-
-uint32_t
-ClangASTContext::GetNumDirectBaseClasses (const CompilerType& type)
+void
+ClangASTContext::ForEachEnumerator (void* type, std::function <bool (const CompilerType &integer_type, const ConstString &name, const llvm::APSInt &value)> const &callback)
{
- if (!type)
- return 0;
- ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext();
- if (!ast)
- return 0;
-
- uint32_t count = 0;
- clang::QualType qual_type(GetCanonicalQualType(type));
- const clang::Type::TypeClass type_class = qual_type->getTypeClass();
- switch (type_class)
+ const clang::EnumType *enum_type = llvm::dyn_cast<clang::EnumType>(GetCanonicalQualType(type));
+ if (enum_type)
{
- case clang::Type::Record:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
- {
- const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
- if (cxx_record_decl)
- count = cxx_record_decl->getNumBases();
- }
- break;
-
- case clang::Type::ObjCObjectPointer:
- count = GetNumDirectBaseClasses(ast->GetPointeeType(type.GetOpaqueQualType()));
- break;
-
- case clang::Type::ObjCObject:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
- {
- const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
- if (objc_class_type)
- {
- clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
-
- if (class_interface_decl && class_interface_decl->getSuperClass())
- count = 1;
- }
- }
- break;
- case clang::Type::ObjCInterface:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
- {
- const clang::ObjCInterfaceType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
- if (objc_interface_type)
- {
- clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
-
- if (class_interface_decl && class_interface_decl->getSuperClass())
- count = 1;
- }
- }
- break;
-
-
- case clang::Type::Typedef:
- count = GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()));
- break;
-
- case clang::Type::Elaborated:
- count = GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()));
- break;
-
- case clang::Type::Paren:
- return GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()));
-
- default:
- break;
- }
- return count;
-}
+ const clang::EnumDecl *enum_decl = enum_type->getDecl();
+ if (enum_decl)
+ {
+ CompilerType integer_type(this, enum_decl->getIntegerType().getAsOpaquePtr());
-uint32_t
-ClangASTContext::GetNumVirtualBaseClasses (const CompilerType& type)
-{
- if (!type)
- return 0;
- ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext();
- if (!ast)
- return 0;
-
- uint32_t count = 0;
- clang::QualType qual_type(GetCanonicalQualType(type));
- const clang::Type::TypeClass type_class = qual_type->getTypeClass();
- switch (type_class)
- {
- case clang::Type::Record:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
+ clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
+ for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
{
- const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
- if (cxx_record_decl)
- count = cxx_record_decl->getNumVBases();
+ ConstString name(enum_pos->getNameAsString().c_str());
+ if (!callback (integer_type, name, enum_pos->getInitVal()))
+ break;
}
- break;
-
- case clang::Type::Typedef:
- count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()));
- break;
-
- case clang::Type::Elaborated:
- count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()));
- break;
-
- case clang::Type::Paren:
- count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()));
- break;
-
- default:
- break;
+ }
}
- return count;
}
+
+#pragma mark Aggregate Types
+
uint32_t
ClangASTContext::GetNumFields (void* type)
{
@@ -5118,104 +4940,177 @@ ClangASTContext::GetNumFields (void* typ
return count;
}
+static clang_type_t
+GetObjCFieldAtIndex (clang::ASTContext *ast,
+ clang::ObjCInterfaceDecl *class_interface_decl,
+ size_t idx,
+ std::string& name,
+ uint64_t *bit_offset_ptr,
+ uint32_t *bitfield_bit_size_ptr,
+ bool *is_bitfield_ptr)
+{
+ if (class_interface_decl)
+ {
+ if (idx < (class_interface_decl->ivar_size()))
+ {
+ clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+ uint32_t ivar_idx = 0;
+
+ for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos, ++ivar_idx)
+ {
+ if (ivar_idx == idx)
+ {
+ const clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
+
+ clang::QualType ivar_qual_type(ivar_decl->getType());
+
+ name.assign(ivar_decl->getNameAsString());
+
+ if (bit_offset_ptr)
+ {
+ const clang::ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
+ *bit_offset_ptr = interface_layout.getFieldOffset (ivar_idx);
+ }
+
+ const bool is_bitfield = ivar_pos->isBitField();
+
+ if (bitfield_bit_size_ptr)
+ {
+ *bitfield_bit_size_ptr = 0;
+
+ if (is_bitfield && ast)
+ {
+ clang::Expr *bitfield_bit_size_expr = ivar_pos->getBitWidth();
+ llvm::APSInt bitfield_apsint;
+ if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *ast))
+ {
+ *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
+ }
+ }
+ }
+ if (is_bitfield_ptr)
+ *is_bitfield_ptr = is_bitfield;
+
+ return ivar_qual_type.getAsOpaquePtr();
+ }
+ }
+ }
+ }
+ return nullptr;
+}
+
CompilerType
-ClangASTContext::GetDirectBaseClassAtIndex (const CompilerType& type, size_t idx, uint32_t *bit_offset_ptr)
+ClangASTContext::GetFieldAtIndex (void* type, size_t idx,
+ std::string& name,
+ uint64_t *bit_offset_ptr,
+ uint32_t *bitfield_bit_size_ptr,
+ bool *is_bitfield_ptr)
{
if (!type)
return CompilerType();
- ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext();
- if (!ast)
- return CompilerType();
clang::QualType qual_type(GetCanonicalQualType(type));
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
case clang::Type::Record:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
+ if (GetCompleteType(type))
{
- const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
- if (cxx_record_decl)
+ const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+ const clang::RecordDecl *record_decl = record_type->getDecl();
+ uint32_t field_idx = 0;
+ clang::RecordDecl::field_iterator field, field_end;
+ for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx)
{
- uint32_t curr_idx = 0;
- clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
- for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
- base_class != base_class_end;
- ++base_class, ++curr_idx)
+ if (idx == field_idx)
{
- if (curr_idx == idx)
+ // Print the member type if requested
+ // Print the member name and equal sign
+ name.assign(field->getNameAsString());
+
+ // Figure out the type byte size (field_type_info.first) and
+ // alignment (field_type_info.second) from the AST context.
+ if (bit_offset_ptr)
{
- if (bit_offset_ptr)
- {
- const clang::ASTRecordLayout &record_layout = ast->getASTContext()->getASTRecordLayout(cxx_record_decl);
- const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
- if (base_class->isVirtual())
- *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
- else
- *bit_offset_ptr = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
+ const clang::ASTRecordLayout &record_layout = getASTContext()->getASTRecordLayout(record_decl);
+ *bit_offset_ptr = record_layout.getFieldOffset (field_idx);
+ }
+
+ const bool is_bitfield = field->isBitField();
+
+ if (bitfield_bit_size_ptr)
+ {
+ *bitfield_bit_size_ptr = 0;
+
+ if (is_bitfield)
+ {
+ clang::Expr *bitfield_bit_size_expr = field->getBitWidth();
+ llvm::APSInt bitfield_apsint;
+ if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *getASTContext()))
+ {
+ *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
+ }
}
- return CompilerType (ast, base_class->getType().getAsOpaquePtr());
}
+ if (is_bitfield_ptr)
+ *is_bitfield_ptr = is_bitfield;
+
+ return CompilerType (getASTContext(), field->getType());
}
}
}
break;
case clang::Type::ObjCObjectPointer:
- return GetDirectBaseClassAtIndex(ast->GetPointeeType(type.GetOpaqueQualType()), idx, bit_offset_ptr);
-
- case clang::Type::ObjCObject:
- if (idx == 0 && ast->GetCompleteType(type.GetOpaqueQualType()))
+ if (GetCompleteType(type))
{
- const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
+ const clang::ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
if (objc_class_type)
{
- clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
-
- if (class_interface_decl)
- {
- clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
- if (superclass_interface_decl)
- {
- if (bit_offset_ptr)
- *bit_offset_ptr = 0;
- return CompilerType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl));
- }
- }
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
+ return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
}
}
break;
+
+ case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
- if (idx == 0 && ast->GetCompleteType(type.GetOpaqueQualType()))
+ if (GetCompleteType(type))
{
- const clang::ObjCObjectType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
- if (objc_interface_type)
+ const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
+ assert (objc_class_type);
+ if (objc_class_type)
{
- clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
-
- if (class_interface_decl)
- {
- clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
- if (superclass_interface_decl)
- {
- if (bit_offset_ptr)
- *bit_offset_ptr = 0;
- return CompilerType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl));
- }
- }
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+ return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
}
}
break;
case clang::Type::Typedef:
- return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr);
+ return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).
+ GetFieldAtIndex (idx,
+ name,
+ bit_offset_ptr,
+ bitfield_bit_size_ptr,
+ is_bitfield_ptr);
case clang::Type::Elaborated:
- return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr);
+ return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).
+ GetFieldAtIndex (idx,
+ name,
+ bit_offset_ptr,
+ bitfield_bit_size_ptr,
+ is_bitfield_ptr);
case clang::Type::Paren:
- return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr);
+ return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).
+ GetFieldAtIndex (idx,
+ name,
+ bit_offset_ptr,
+ bitfield_bit_size_ptr,
+ is_bitfield_ptr);
default:
break;
@@ -5223,28 +5118,125 @@ ClangASTContext::GetDirectBaseClassAtInd
return CompilerType();
}
+uint32_t
+ClangASTContext::GetNumDirectBaseClasses (void *type)
+{
+ uint32_t count = 0;
+ clang::QualType qual_type(GetCanonicalQualType(type));
+ const clang::Type::TypeClass type_class = qual_type->getTypeClass();
+ switch (type_class)
+ {
+ case clang::Type::Record:
+ if (GetCompleteType(type))
+ {
+ const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+ if (cxx_record_decl)
+ count = cxx_record_decl->getNumBases();
+ }
+ break;
+
+ case clang::Type::ObjCObjectPointer:
+ count = GetPointeeType(type).GetNumDirectBaseClasses();
+ break;
+
+ case clang::Type::ObjCObject:
+ if (GetCompleteType(type))
+ {
+ const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
+ if (objc_class_type)
+ {
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+
+ if (class_interface_decl && class_interface_decl->getSuperClass())
+ count = 1;
+ }
+ }
+ break;
+ case clang::Type::ObjCInterface:
+ if (GetCompleteType(type))
+ {
+ const clang::ObjCInterfaceType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
+ if (objc_interface_type)
+ {
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
+
+ if (class_interface_decl && class_interface_decl->getSuperClass())
+ count = 1;
+ }
+ }
+ break;
+
+
+ case clang::Type::Typedef:
+ count = GetNumDirectBaseClasses(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
+ break;
+
+ case clang::Type::Elaborated:
+ count = GetNumDirectBaseClasses(llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
+ break;
+
+ case clang::Type::Paren:
+ return GetNumDirectBaseClasses(llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());
+
+ default:
+ break;
+ }
+ return count;
+
+}
+
+uint32_t
+ClangASTContext::GetNumVirtualBaseClasses (void *type)
+{
+ uint32_t count = 0;
+ clang::QualType qual_type(GetCanonicalQualType(type));
+ const clang::Type::TypeClass type_class = qual_type->getTypeClass();
+ switch (type_class)
+ {
+ case clang::Type::Record:
+ if (GetCompleteType(type))
+ {
+ const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+ if (cxx_record_decl)
+ count = cxx_record_decl->getNumVBases();
+ }
+ break;
+
+ case clang::Type::Typedef:
+ count = GetNumVirtualBaseClasses(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
+ break;
+
+ case clang::Type::Elaborated:
+ count = GetNumVirtualBaseClasses(llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
+ break;
+
+ case clang::Type::Paren:
+ count = GetNumVirtualBaseClasses(llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());
+ break;
+
+ default:
+ break;
+ }
+ return count;
+
+}
+
CompilerType
-ClangASTContext::GetVirtualBaseClassAtIndex (const CompilerType& type, size_t idx, uint32_t *bit_offset_ptr)
+ClangASTContext::GetDirectBaseClassAtIndex (void *type, size_t idx, uint32_t *bit_offset_ptr)
{
- if (!type)
- return CompilerType();
- ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext();
- if (!ast)
- return CompilerType();
-
clang::QualType qual_type(GetCanonicalQualType(type));
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
case clang::Type::Record:
- if (ast->GetCompleteType(type.GetOpaqueQualType()))
+ if (GetCompleteType(type))
{
const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
if (cxx_record_decl)
{
uint32_t curr_idx = 0;
clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
- for (base_class = cxx_record_decl->vbases_begin(), base_class_end = cxx_record_decl->vbases_end();
+ for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
base_class != base_class_end;
++base_class, ++curr_idx)
{
@@ -5252,102 +5244,87 @@ ClangASTContext::GetVirtualBaseClassAtIn
{
if (bit_offset_ptr)
{
- const clang::ASTRecordLayout &record_layout = ast->getASTContext()->getASTRecordLayout(cxx_record_decl);
+ const clang::ASTRecordLayout &record_layout = getASTContext()->getASTRecordLayout(cxx_record_decl);
const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
- *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
-
+ if (base_class->isVirtual())
+ *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
+ else
+ *bit_offset_ptr = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
}
- return CompilerType (ast, base_class->getType().getAsOpaquePtr());
+ return CompilerType (this, base_class->getType().getAsOpaquePtr());
}
}
}
}
break;
-
- case clang::Type::Typedef:
- return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr);
-
- case clang::Type::Elaborated:
- return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr);
-
- case clang::Type::Paren:
- return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr);
-
- default:
- break;
- }
- return CompilerType();
-}
-static clang_type_t
-GetObjCFieldAtIndex (clang::ASTContext *ast,
- clang::ObjCInterfaceDecl *class_interface_decl,
- size_t idx,
- std::string& name,
- uint64_t *bit_offset_ptr,
- uint32_t *bitfield_bit_size_ptr,
- bool *is_bitfield_ptr)
-{
- if (class_interface_decl)
- {
- if (idx < (class_interface_decl->ivar_size()))
- {
- clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
- uint32_t ivar_idx = 0;
-
- for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos, ++ivar_idx)
+ case clang::Type::ObjCObjectPointer:
+ return GetPointeeType(type).GetDirectBaseClassAtIndex(idx, bit_offset_ptr);
+
+ case clang::Type::ObjCObject:
+ if (idx == 0 && GetCompleteType(type))
{
- if (ivar_idx == idx)
+ const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
+ if (objc_class_type)
{
- const clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
-
- clang::QualType ivar_qual_type(ivar_decl->getType());
-
- name.assign(ivar_decl->getNameAsString());
-
- if (bit_offset_ptr)
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+
+ if (class_interface_decl)
{
- const clang::ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
- *bit_offset_ptr = interface_layout.getFieldOffset (ivar_idx);
+ clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+ if (superclass_interface_decl)
+ {
+ if (bit_offset_ptr)
+ *bit_offset_ptr = 0;
+ return CompilerType (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl));
+ }
}
-
- const bool is_bitfield = ivar_pos->isBitField();
-
- if (bitfield_bit_size_ptr)
+ }
+ }
+ break;
+ case clang::Type::ObjCInterface:
+ if (idx == 0 && GetCompleteType(type))
+ {
+ const clang::ObjCObjectType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
+ if (objc_interface_type)
+ {
+ clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
+
+ if (class_interface_decl)
{
- *bitfield_bit_size_ptr = 0;
-
- if (is_bitfield && ast)
+ clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+ if (superclass_interface_decl)
{
- clang::Expr *bitfield_bit_size_expr = ivar_pos->getBitWidth();
- llvm::APSInt bitfield_apsint;
- if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *ast))
- {
- *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
- }
+ if (bit_offset_ptr)
+ *bit_offset_ptr = 0;
+ return CompilerType (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl));
}
}
- if (is_bitfield_ptr)
- *is_bitfield_ptr = is_bitfield;
-
- return ivar_qual_type.getAsOpaquePtr();
}
}
- }
+ break;
+
+
+ case clang::Type::Typedef:
+ return GetDirectBaseClassAtIndex (llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), idx, bit_offset_ptr);
+
+ case clang::Type::Elaborated:
+ return GetDirectBaseClassAtIndex (llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), idx, bit_offset_ptr);
+
+ case clang::Type::Paren:
+ return GetDirectBaseClassAtIndex (llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(), idx, bit_offset_ptr);
+
+ default:
+ break;
}
- return nullptr;
+ return CompilerType();
}
CompilerType
-ClangASTContext::GetFieldAtIndex (void* type, size_t idx,
- std::string& name,
- uint64_t *bit_offset_ptr,
- uint32_t *bitfield_bit_size_ptr,
- bool *is_bitfield_ptr)
+ClangASTContext::GetVirtualBaseClassAtIndex (void *type,
+ size_t idx,
+ uint32_t *bit_offset_ptr)
{
- if (!type)
- return CompilerType();
-
clang::QualType qual_type(GetCanonicalQualType(type));
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
@@ -5355,106 +5332,45 @@ ClangASTContext::GetFieldAtIndex (void*
case clang::Type::Record:
if (GetCompleteType(type))
{
- const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
- const clang::RecordDecl *record_decl = record_type->getDecl();
- uint32_t field_idx = 0;
- clang::RecordDecl::field_iterator field, field_end;
- for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx)
+ const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+ if (cxx_record_decl)
{
- if (idx == field_idx)
+ uint32_t curr_idx = 0;
+ clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+ for (base_class = cxx_record_decl->vbases_begin(), base_class_end = cxx_record_decl->vbases_end();
+ base_class != base_class_end;
+ ++base_class, ++curr_idx)
{
- // Print the member type if requested
- // Print the member name and equal sign
- name.assign(field->getNameAsString());
-
- // Figure out the type byte size (field_type_info.first) and
- // alignment (field_type_info.second) from the AST context.
- if (bit_offset_ptr)
- {
- const clang::ASTRecordLayout &record_layout = getASTContext()->getASTRecordLayout(record_decl);
- *bit_offset_ptr = record_layout.getFieldOffset (field_idx);
- }
-
- const bool is_bitfield = field->isBitField();
-
- if (bitfield_bit_size_ptr)
+ if (curr_idx == idx)
{
- *bitfield_bit_size_ptr = 0;
-
- if (is_bitfield)
+ if (bit_offset_ptr)
{
- clang::Expr *bitfield_bit_size_expr = field->getBitWidth();
- llvm::APSInt bitfield_apsint;
- if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *getASTContext()))
- {
- *bitfield_bit_size_ptr = bitfield_apsint.getLimitedValue();
- }
+ const clang::ASTRecordLayout &record_layout = getASTContext()->getASTRecordLayout(cxx_record_decl);
+ const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
+ *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
+
}
+ return CompilerType (this, base_class->getType().getAsOpaquePtr());
}
- if (is_bitfield_ptr)
- *is_bitfield_ptr = is_bitfield;
-
- return CompilerType (getASTContext(), field->getType());
}
}
}
break;
-
- case clang::Type::ObjCObjectPointer:
- if (GetCompleteType(type))
- {
- const clang::ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
- if (objc_class_type)
- {
- clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
- return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
- }
- }
- break;
-
- case clang::Type::ObjCObject:
- case clang::Type::ObjCInterface:
- if (GetCompleteType(type))
- {
- const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
- assert (objc_class_type);
- if (objc_class_type)
- {
- clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
- return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
- }
- }
- break;
-
-
+
case clang::Type::Typedef:
- return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).
- GetFieldAtIndex (idx,
- name,
- bit_offset_ptr,
- bitfield_bit_size_ptr,
- is_bitfield_ptr);
-
+ return GetVirtualBaseClassAtIndex (llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), idx, bit_offset_ptr);
+
case clang::Type::Elaborated:
- return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).
- GetFieldAtIndex (idx,
- name,
- bit_offset_ptr,
- bitfield_bit_size_ptr,
- is_bitfield_ptr);
-
+ return GetVirtualBaseClassAtIndex (llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), idx, bit_offset_ptr);
+
case clang::Type::Paren:
- return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).
- GetFieldAtIndex (idx,
- name,
- bit_offset_ptr,
- bitfield_bit_size_ptr,
- is_bitfield_ptr);
-
+ return GetVirtualBaseClassAtIndex (llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(), idx, bit_offset_ptr);
+
default:
break;
}
return CompilerType();
+
}
// If a pointer to a pointee type (the clang_type arg) says that it has no
@@ -5564,19 +5480,20 @@ ClangASTContext::GetNumPointeeChildren (
CompilerType
-ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx,
- size_t idx,
- bool transparent_pointers,
- bool omit_empty_base_classes,
- bool ignore_array_bounds,
- std::string& child_name,
- uint32_t &child_byte_size,
- int32_t &child_byte_offset,
- uint32_t &child_bitfield_bit_size,
- uint32_t &child_bitfield_bit_offset,
- bool &child_is_base_class,
- bool &child_is_deref_of_parent,
- ValueObject *valobj)
+ClangASTContext::GetChildClangTypeAtIndex (void* type,
+ ExecutionContext *exe_ctx,
+ size_t idx,
+ bool transparent_pointers,
+ bool omit_empty_base_classes,
+ bool ignore_array_bounds,
+ std::string& child_name,
+ uint32_t &child_byte_size,
+ int32_t &child_byte_offset,
+ uint32_t &child_bitfield_bit_size,
+ uint32_t &child_bitfield_bit_offset,
+ bool &child_is_base_class,
+ bool &child_is_deref_of_parent,
+ ValueObject *valobj)
{
if (!type)
return CompilerType();
@@ -8973,7 +8890,7 @@ ClangASTContext::ParseTemplateDIE (Symbo
const dw_offset_t type_die_offset = form_value.Reference();
lldb_type = dwarf->ResolveTypeUID(type_die_offset);
if (lldb_type)
- clang_type = lldb_type->GetClangForwardType();
+ clang_type = lldb_type->GetForwardCompilerType ();
}
break;
@@ -9386,6 +9303,28 @@ ClangASTContext::CompleteTypeFromDWARF (
return false;
}
+CompilerDeclContext
+ClangASTContext::GetDeclContextForUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry* die)
+{
+ clang::DeclContext *clang_decl_ctx = GetClangDeclContextForDIE (dwarf, cu, die);
+ if (clang_decl_ctx)
+ return CompilerDeclContext(this, clang_decl_ctx);
+ return CompilerDeclContext();
+}
+
+CompilerDeclContext
+ClangASTContext::GetDeclContextContainingUIDFromDWARF (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry* die)
+{
+ clang::DeclContext *clang_decl_ctx = GetClangDeclContextContainingDIE (dwarf, cu, die, nullptr);
+ if (clang_decl_ctx)
+ return CompilerDeclContext(this, clang_decl_ctx);
+ return CompilerDeclContext();
+}
+
void
ClangASTContext::CompleteTagDecl (void *baton, clang::TagDecl *decl)
{
@@ -10015,7 +9954,7 @@ ClangASTContext::ParseChildMembers (cons
accessibility = eAccessPublic;
ClangASTContext::AddVariableToRecordType (class_clang_type,
name,
- var_type->GetClangLayoutType(),
+ var_type->GetLayoutCompilerType (),
accessibility);
}
break;
@@ -10149,7 +10088,7 @@ ClangASTContext::ParseChildMembers (cons
last_field_info.Clear();
}
- CompilerType member_clang_type = member_type->GetClangLayoutType();
+ CompilerType member_clang_type = member_type->GetLayoutCompilerType ();
{
// Older versions of clang emit array[0] and array[1] in the same way (<rdar://problem/12566646>).
@@ -10221,7 +10160,7 @@ ClangASTContext::ParseChildMembers (cons
metadata.SetUserID (dwarf->MakeUserID(die->GetOffset()));
delayed_properties.push_back(DelayedAddObjCClassProperty(class_clang_type,
prop_name,
- member_type->GetClangLayoutType(),
+ member_type->GetLayoutCompilerType (),
ivar_decl,
prop_setter_name,
prop_getter_name,
@@ -10335,7 +10274,7 @@ ClangASTContext::ParseChildMembers (cons
break;
}
- CompilerType base_class_clang_type = base_class_type->GetClangFullType();
+ CompilerType base_class_clang_type = base_class_type->GetFullCompilerType ();
assert (base_class_clang_type);
if (class_language == eLanguageTypeObjC)
{
@@ -10520,10 +10459,10 @@ ClangASTContext::ParseChildParameters (c
Type *type = dwarf->ResolveTypeUID(param_type_die_offset);
if (type)
{
- function_param_types.push_back (type->GetClangForwardType());
+ function_param_types.push_back (type->GetForwardCompilerType ());
clang::ParmVarDecl *param_var_decl = CreateParameterDeclaration (name,
- type->GetClangForwardType(),
+ type->GetForwardCompilerType (),
storage);
assert(param_var_decl);
function_param_decls.push_back(param_var_decl);
@@ -10650,91 +10589,198 @@ ClangASTContext::ParseChildArrayInfo (co
}
}
-clang::DeclContext*
-ClangASTContext::GetClangDeclContextContainingTypeUID (SymbolFileDWARF *dwarf, lldb::user_id_t type_uid)
+//clang::DeclContext*
+//ClangASTContext::GetClangDeclContextContainingTypeUID (SymbolFileDWARF *dwarf, lldb::user_id_t type_uid)
+//{
+// DWARFDebugInfo* debug_info = dwarf->DebugInfo();
+// if (debug_info && dwarf->UserIDMatches(type_uid))
+// {
+// DWARFCompileUnitSP cu_sp;
+// const DWARFDebugInfoEntry* die = debug_info->GetDIEPtr(type_uid, &cu_sp);
+// if (die)
+// return GetClangDeclContextContainingDIE (dwarf, cu_sp.get(), die, NULL);
+// }
+// return NULL;
+//}
+//
+//----------------------------------------------------------------------
+// CompilerDeclContext functions
+//----------------------------------------------------------------------
+
+bool
+ClangASTContext::DeclContextIsStructUnionOrClass (void *opaque_decl_ctx)
+{
+ if (opaque_decl_ctx)
+ return ((clang::DeclContext *)opaque_decl_ctx)->isRecord();
+ else
+ return false;
+}
+
+ConstString
+ClangASTContext::DeclContextGetName (void *opaque_decl_ctx)
{
- DWARFDebugInfo* debug_info = dwarf->DebugInfo();
- if (debug_info && dwarf->UserIDMatches(type_uid))
+ if (opaque_decl_ctx)
{
- DWARFCompileUnitSP cu_sp;
- const DWARFDebugInfoEntry* die = debug_info->GetDIEPtr(type_uid, &cu_sp);
- if (die)
- return GetClangDeclContextContainingDIE (dwarf, cu_sp.get(), die, NULL);
+ clang::NamedDecl *named_decl = llvm::dyn_cast<clang::NamedDecl>((clang::DeclContext *)opaque_decl_ctx);
+ if (named_decl)
+ return ConstString(named_decl->getName());
}
- return NULL;
+ return ConstString();
}
-clang::DeclContext*
-ClangASTContext::GetClangDeclContextForTypeUID (SymbolFileDWARF *dwarf, const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid)
+bool
+ClangASTContext::DeclContextIsClassMethod (void *opaque_decl_ctx,
+ lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr)
{
- if (dwarf->UserIDMatches(type_uid))
- return GetClangDeclContextForDIEOffset (dwarf, sc, type_uid);
- return NULL;
+ if (opaque_decl_ctx)
+ {
+ clang::DeclContext *decl_ctx = (clang::DeclContext *)opaque_decl_ctx;
+ if (ObjCMethodDecl *objc_method = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
+ {
+ if (is_instance_method_ptr)
+ *is_instance_method_ptr = objc_method->isInstanceMethod();
+ if (language_ptr)
+ *language_ptr = eLanguageTypeObjC;
+ if (language_object_name_ptr)
+ language_object_name_ptr->SetCString("self");
+ return true;
+ }
+ else if (CXXMethodDecl *cxx_method = llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx))
+ {
+ if (is_instance_method_ptr)
+ *is_instance_method_ptr = cxx_method->isInstance();
+ if (language_ptr)
+ *language_ptr = eLanguageTypeC_plus_plus;
+ if (language_object_name_ptr)
+ language_object_name_ptr->SetCString("this");
+ return true;
+ }
+ else if (clang::FunctionDecl *function_decl = llvm::dyn_cast<clang::FunctionDecl>(decl_ctx))
+ {
+ ClangASTMetadata *metadata = GetMetadata (&decl_ctx->getParentASTContext(), function_decl);
+ if (metadata && metadata->HasObjectPtr())
+ {
+ if (is_instance_method_ptr)
+ *is_instance_method_ptr = true;
+ if (language_ptr)
+ *language_ptr = eLanguageTypeObjC;
+ if (language_object_name_ptr)
+ language_object_name_ptr->SetCString (metadata->GetObjectPtrName());
+ return true;
+ }
+ }
+ }
+ return false;
}
-
clang::DeclContext *
-ClangASTContext::GetClangDeclContextForDIE (SymbolFileDWARF *dwarf,
- const SymbolContext &sc,
- DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry *die)
+ClangASTContext::DeclContextGetAsDeclContext (const CompilerDeclContext &dc)
{
- clang::DeclContext *clang_decl_ctx = GetCachedClangDeclContextForDIE (die);
- if (clang_decl_ctx)
- return clang_decl_ctx;
- // If this DIE has a specification, or an abstract origin, then trace to those.
+ if (dc.IsClang())
+ return (clang::DeclContext *)dc.GetOpaqueDeclContext();
+ return nullptr;
+}
- dw_offset_t die_offset = die->GetAttributeValueAsReference(dwarf, cu, DW_AT_specification, DW_INVALID_OFFSET);
- if (die_offset != DW_INVALID_OFFSET)
- return GetClangDeclContextForDIEOffset (dwarf, sc, die_offset);
-
- die_offset = die->GetAttributeValueAsReference(dwarf, cu, DW_AT_abstract_origin, DW_INVALID_OFFSET);
- if (die_offset != DW_INVALID_OFFSET)
- return GetClangDeclContextForDIEOffset (dwarf, sc, die_offset);
- Log *log = nullptr; //(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
- if (log)
- dwarf->GetObjectFile()->GetModule()->LogMessage(log, "SymbolFileDWARF::GetClangDeclContextForDIE (die = 0x%8.8x) %s '%s'", die->GetOffset(), DW_TAG_value_to_name(die->Tag()), die->GetName(dwarf, cu));
- // This is the DIE we want. Parse it, then query our map.
- bool assert_not_being_parsed = true;
- dwarf->ResolveTypeUID (cu, die, assert_not_being_parsed);
+ObjCMethodDecl *
+ClangASTContext::DeclContextGetAsObjCMethodDecl (const CompilerDeclContext &dc)
+{
+ if (dc.IsClang())
+ return llvm::dyn_cast<clang::ObjCMethodDecl>((clang::DeclContext *)dc.GetOpaqueDeclContext());
+ return nullptr;
+}
- clang_decl_ctx = GetCachedClangDeclContextForDIE (die);
+CXXMethodDecl *
+ClangASTContext::DeclContextGetAsCXXMethodDecl (const CompilerDeclContext &dc)
+{
+ if (dc.IsClang())
+ return llvm::dyn_cast<clang::CXXMethodDecl>((clang::DeclContext *)dc.GetOpaqueDeclContext());
+ return nullptr;
+}
- return clang_decl_ctx;
+clang::FunctionDecl *
+ClangASTContext::DeclContextGetAsFunctionDecl (const CompilerDeclContext &dc)
+{
+ if (dc.IsClang())
+ return llvm::dyn_cast<clang::FunctionDecl>((clang::DeclContext *)dc.GetOpaqueDeclContext());
+ return nullptr;
}
+clang::NamespaceDecl *
+ClangASTContext::DeclContextGetAsNamespaceDecl (const CompilerDeclContext &dc)
+{
+ if (dc.IsClang())
+ return llvm::dyn_cast<clang::NamespaceDecl>((clang::DeclContext *)dc.GetOpaqueDeclContext());
+ return nullptr;
+}
-clang::DeclContext *
-ClangASTContext::GetClangDeclContextContainingDIEOffset (SymbolFileDWARF *dwarf,
- dw_offset_t die_offset)
+ClangASTMetadata *
+ClangASTContext::DeclContextGetMetaData (const CompilerDeclContext &dc, const void *object)
+{
+ clang::ASTContext *ast = DeclContextGetClangASTContext (dc);
+ if (ast)
+ return ClangASTContext::GetMetadata (ast, object);
+ return nullptr;
+}
+
+clang::ASTContext *
+ClangASTContext::DeclContextGetClangASTContext (const CompilerDeclContext &dc)
{
- if (die_offset != DW_INVALID_OFFSET)
+ TypeSystem *type_system = dc.GetTypeSystem();
+ if (type_system)
{
- DWARFCompileUnitSP cu_sp;
- const DWARFDebugInfoEntry* die = dwarf->DebugInfo()->GetDIEPtr(die_offset, &cu_sp);
- return GetClangDeclContextContainingDIE (dwarf, cu_sp.get(), die, NULL);
+ ClangASTContext *ast = type_system->AsClangASTContext();
+ if (ast)
+ return ast->getASTContext();
}
- return NULL;
+ return nullptr;
}
+
clang::DeclContext *
-ClangASTContext::GetClangDeclContextForDIEOffset (SymbolFileDWARF *dwarf,
- const SymbolContext &sc,
- dw_offset_t die_offset)
-{
- if (die_offset != DW_INVALID_OFFSET)
- {
- DWARFDebugInfo* debug_info = dwarf->DebugInfo();
- if (debug_info)
- {
- DWARFCompileUnitSP cu_sp;
- const DWARFDebugInfoEntry* die = debug_info->GetDIEPtr(die_offset, &cu_sp);
- if (die)
- return GetClangDeclContextForDIE (dwarf, sc, cu_sp.get(), die);
+ClangASTContext::GetClangDeclContextForDIE (SymbolFileDWARF *dwarf,
+ DWARFCompileUnit *cu,
+ const DWARFDebugInfoEntry *die)
+{
+ if (die)
+ {
+ clang::DeclContext *decl_ctx = GetCachedClangDeclContextForDIE (die);
+ if (decl_ctx)
+ return decl_ctx;
+
+ bool try_parsing_type = true;
+ switch (die->Tag())
+ {
+ case DW_TAG_compile_unit:
+ decl_ctx = m_clang_tu_decl;
+ try_parsing_type = false;
+ break;
+
+ case DW_TAG_namespace:
+ decl_ctx = ResolveNamespaceDIE (dwarf, cu, die);
+ try_parsing_type = false;
+ break;
+
+ default:
+ break;
+ }
+
+ if (decl_ctx == nullptr && try_parsing_type)
+ {
+ Type* type = dwarf->ResolveType (cu, die);
+ if (type)
+ decl_ctx = GetCachedClangDeclContextForDIE (die);
+ }
+
+ if (decl_ctx)
+ {
+ LinkDeclContextToDIE (decl_ctx, die);
+ return decl_ctx;
}
}
- return NULL;
+ return nullptr;
}
clang::NamespaceDecl *
@@ -10783,7 +10829,7 @@ ClangASTContext::ResolveNamespaceDIE (Sy
return namespace_decl;
}
}
- return NULL;
+ return nullptr;
}
clang::DeclContext *
@@ -10802,40 +10848,9 @@ ClangASTContext::GetClangDeclContextCont
if (decl_ctx_die)
{
-
- DIEToDeclContextMap::iterator pos = m_die_to_decl_ctx.find (decl_ctx_die);
- if (pos != m_die_to_decl_ctx.end())
- return pos->second;
-
- switch (decl_ctx_die->Tag())
- {
- case DW_TAG_compile_unit:
- return m_clang_tu_decl;
-
- case DW_TAG_namespace:
- return ResolveNamespaceDIE (dwarf, cu, decl_ctx_die);
-
- case DW_TAG_structure_type:
- case DW_TAG_union_type:
- case DW_TAG_class_type:
- {
- Type* type = dwarf->ResolveType (cu, decl_ctx_die);
- if (type)
- {
- clang::DeclContext *decl_ctx = GetDeclContextForType(type->GetClangForwardType());
- if (decl_ctx)
- {
- LinkDeclContextToDIE (decl_ctx, decl_ctx_die);
- if (decl_ctx)
- return decl_ctx;
- }
- }
- }
- break;
-
- default:
- break;
- }
+ clang::DeclContext *clang_decl_ctx = GetClangDeclContextForDIE (dwarf, cu, decl_ctx_die);
+ if (clang_decl_ctx)
+ return clang_decl_ctx;
}
return m_clang_tu_decl;
}
@@ -11356,7 +11371,7 @@ ClangASTContext::ParseTypeFromDWARF (con
}
assert (tag_decl_kind != -1);
bool clang_type_was_created = false;
- clang_type.SetClangType(this, dwarf->m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetCompilerType(this, dwarf->m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
const DWARFDebugInfoEntry *decl_ctx_die;
@@ -11567,14 +11582,14 @@ ClangASTContext::ParseTypeFromDWARF (con
DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", dwarf->MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
CompilerType enumerator_clang_type;
- clang_type.SetClangType (this, dwarf->m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetCompilerType (this, dwarf->m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
if (encoding_uid != DW_INVALID_OFFSET)
{
Type *enumerator_type = dwarf->ResolveTypeUID(encoding_uid);
if (enumerator_type)
- enumerator_clang_type = enumerator_type->GetClangFullType();
+ enumerator_clang_type = enumerator_type->GetFullCompilerType ();
}
if (!enumerator_clang_type)
@@ -11742,7 +11757,7 @@ ClangASTContext::ParseTypeFromDWARF (con
func_type = dwarf->ResolveTypeUID(type_die_offset);
if (func_type)
- return_clang_type = func_type->GetClangForwardType();
+ return_clang_type = func_type->GetForwardCompilerType ();
else
return_clang_type = GetBasicType(eBasicTypeVoid);
@@ -11790,7 +11805,8 @@ ClangASTContext::ParseTypeFromDWARF (con
if (type_name_cstr)
{
bool type_handled = false;
- if (tag == DW_TAG_subprogram)
+ if (tag == DW_TAG_subprogram ||
+ tag == DW_TAG_inlined_subroutine)
{
ObjCLanguageRuntime::MethodName objc_method (type_name_cstr, true);
if (objc_method.IsValid(true))
@@ -11803,7 +11819,7 @@ ClangASTContext::ParseTypeFromDWARF (con
if (complete_objc_class_type_sp)
{
- CompilerType type_clang_forward_type = complete_objc_class_type_sp->GetClangForwardType();
+ CompilerType type_clang_forward_type = complete_objc_class_type_sp->GetForwardCompilerType ();
if (ClangASTContext::IsObjCObjectOrInterfaceType(type_clang_forward_type))
class_opaque_type = type_clang_forward_type;
}
@@ -11897,12 +11913,12 @@ ClangASTContext::ParseTypeFromDWARF (con
// prototype off of, so we need this type to be completed so that the
// m_die_to_decl_ctx for the method in the specification has a valid
// clang decl context.
- class_type->GetClangForwardType();
+ class_type->GetForwardCompilerType ();
// If we have a specification, then the function type should have been
// made with the specification and not with this die.
DWARFCompileUnitSP spec_cu_sp;
const DWARFDebugInfoEntry* spec_die = dwarf->DebugInfo()->GetDIEPtr(specification_die_offset, &spec_cu_sp);
- clang::DeclContext *spec_clang_decl_ctx = GetClangDeclContextForDIE (dwarf, sc, dwarf_cu, spec_die);
+ clang::DeclContext *spec_clang_decl_ctx = GetClangDeclContextForDIE (dwarf, dwarf_cu, spec_die);
if (spec_clang_decl_ctx)
{
LinkDeclContextToDIE(spec_clang_decl_ctx, die);
@@ -11921,11 +11937,11 @@ ClangASTContext::ParseTypeFromDWARF (con
// prototype off of, so we need this type to be completed so that the
// m_die_to_decl_ctx for the method in the abstract origin has a valid
// clang decl context.
- class_type->GetClangForwardType();
+ class_type->GetForwardCompilerType ();
DWARFCompileUnitSP abs_cu_sp;
const DWARFDebugInfoEntry* abs_die = dwarf->DebugInfo()->GetDIEPtr(abstract_origin_die_offset, &abs_cu_sp);
- clang::DeclContext *abs_clang_decl_ctx = GetClangDeclContextForDIE (dwarf, sc, dwarf_cu, abs_die);
+ clang::DeclContext *abs_clang_decl_ctx = GetClangDeclContextForDIE (dwarf, dwarf_cu, abs_die);
if (abs_clang_decl_ctx)
{
LinkDeclContextToDIE (abs_clang_decl_ctx, die);
@@ -11940,7 +11956,7 @@ ClangASTContext::ParseTypeFromDWARF (con
}
else
{
- CompilerType class_opaque_type = class_type->GetClangForwardType();
+ CompilerType class_opaque_type = class_type->GetForwardCompilerType ();
if (ClangASTContext::IsCXXClassType(class_opaque_type))
{
if (class_opaque_type.IsBeingDefined ())
@@ -12022,7 +12038,7 @@ ClangASTContext::ParseTypeFromDWARF (con
// Now we get the full type to force our class type to complete itself
// using the clang::ExternalASTSource protocol which will parse all
// base classes and all methods (including the method for this DIE).
- class_type->GetClangFullType();
+ class_type->GetFullCompilerType ();
// The type for this DIE should have been filled in the function call above
type_ptr = dwarf->m_die_to_type[die];
@@ -12161,7 +12177,7 @@ ClangASTContext::ParseTypeFromDWARF (con
ParseChildArrayInfo(sc, dwarf, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride);
if (byte_stride == 0 && bit_stride == 0)
byte_stride = element_type->GetByteSize();
- CompilerType array_element_type = element_type->GetClangForwardType();
+ CompilerType array_element_type = element_type->GetForwardCompilerType ();
uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride;
if (element_orders.size() > 0)
{
@@ -12228,8 +12244,8 @@ ClangASTContext::ParseTypeFromDWARF (con
Type *pointee_type = dwarf->ResolveTypeUID(type_die_offset);
Type *class_type = dwarf->ResolveTypeUID(containing_type_die_offset);
- CompilerType pointee_clang_type = pointee_type->GetClangForwardType();
- CompilerType class_clang_type = class_type->GetClangLayoutType();
+ CompilerType pointee_clang_type = pointee_type->GetForwardCompilerType ();
+ CompilerType class_clang_type = class_type->GetLayoutCompilerType ();
clang_type = ClangASTContext::CreateMemberPointerType(pointee_clang_type, class_clang_type);
@@ -12312,7 +12328,7 @@ ClangASTContext::CopyUniqueClassMethodTy
// We need to complete the class type so we can get all of the method types
// parsed so we can then unique those types to their equivalent counterparts
// in "dst_cu" and "dst_class_die"
- class_type->GetClangFullType();
+ class_type->GetFullCompilerType ();
const DWARFDebugInfoEntry *src_die;
const DWARFDebugInfoEntry *dst_die;
@@ -12601,53 +12617,3 @@ ClangASTContext::CopyUniqueClassMethodTy
return (failures.Size() != 0);
}
-
-bool
-ClangASTContext::DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
- SymbolFileDWARF *dwarf,
- DWARFCompileUnit *cu,
- const DWARFDebugInfoEntry *die)
-{
- // No namespace specified, so the answer is
- if (namespace_decl == NULL)
- return true;
-
- Log *log = nullptr; //(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
-
- const DWARFDebugInfoEntry *decl_ctx_die = NULL;
- clang::DeclContext *die_clang_decl_ctx = GetClangDeclContextContainingDIE (dwarf, cu, die, &decl_ctx_die);
- if (decl_ctx_die)
- {
- clang::NamespaceDecl *clang_namespace_decl = namespace_decl->GetNamespaceDecl();
-
- if (clang_namespace_decl)
- {
- if (decl_ctx_die->Tag() != DW_TAG_namespace)
- {
- if (log)
- dwarf->GetObjectFile()->GetModule()->LogMessage(log, "Found a match, but its parent is not a namespace");
- return false;
- }
-
- if (clang_namespace_decl == die_clang_decl_ctx)
- return true;
- else
- return false;
- }
- else
- {
- // We have a namespace_decl that was not NULL but it contained
- // a NULL "clang::NamespaceDecl", so this means the global namespace
- // So as long the contained decl context DIE isn't a namespace
- // we should be ok.
- if (decl_ctx_die->Tag() != DW_TAG_namespace)
- return true;
- }
- }
-
- if (log)
- dwarf->GetObjectFile()->GetModule()->LogMessage(log, "Found a match, but its parent doesn't exist");
-
- return false;
-}
-
Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Mon Aug 24 18:46:31 2015
@@ -16,7 +16,6 @@
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ClangASTImporter.h"
#include "lldb/Symbol/ClangExternalASTSourceCommon.h"
-#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Utility/LLDBAssert.h"
using namespace lldb_private;
Removed: lldb/trunk/source/Symbol/ClangNamespaceDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangNamespaceDecl.cpp?rev=245904&view=auto
==============================================================================
--- lldb/trunk/source/Symbol/ClangNamespaceDecl.cpp (original)
+++ lldb/trunk/source/Symbol/ClangNamespaceDecl.cpp (removed)
@@ -1,25 +0,0 @@
-//===-- ClangNamespaceDecl.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/Symbol/ClangNamespaceDecl.h"
-
-#include "clang/AST/Decl.h"
-
-namespace lldb_private {
-
-std::string
-ClangNamespaceDecl::GetQualifiedName () const
-{
- if (m_namespace_decl)
- return m_namespace_decl->getQualifiedNameAsString();
- return std::string();
-}
-
-
-}
Added: lldb/trunk/source/Symbol/CompilerDeclContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerDeclContext.cpp?rev=245905&view=auto
==============================================================================
--- lldb/trunk/source/Symbol/CompilerDeclContext.cpp (added)
+++ lldb/trunk/source/Symbol/CompilerDeclContext.cpp Mon Aug 24 18:46:31 2015
@@ -0,0 +1,64 @@
+//===-- CompilerDeclContext.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/Symbol/CompilerDeclContext.h"
+#include "lldb/Symbol/TypeSystem.h"
+
+using namespace lldb_private;
+
+bool
+CompilerDeclContext::IsClang () const
+{
+ return IsValid() && m_type_system->AsClangASTContext() != nullptr;
+}
+
+ConstString
+CompilerDeclContext::GetName () const
+{
+ if (IsValid())
+ return m_type_system->DeclContextGetName(m_opaque_decl_ctx);
+ else
+ return ConstString();
+}
+
+bool
+CompilerDeclContext::IsStructUnionOrClass () const
+{
+ if (IsValid())
+ return m_type_system->DeclContextIsStructUnionOrClass(m_opaque_decl_ctx);
+ else
+ return false;
+}
+
+bool
+CompilerDeclContext::IsClassMethod (lldb::LanguageType *language_ptr,
+ bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr)
+{
+ if (IsValid())
+ return m_type_system->DeclContextIsClassMethod (m_opaque_decl_ctx,
+ language_ptr,
+ is_instance_method_ptr,
+ language_object_name_ptr);
+ else
+ return false;
+}
+
+bool
+lldb_private::operator == (const lldb_private::CompilerDeclContext &lhs, const lldb_private::CompilerDeclContext &rhs)
+{
+ return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDeclContext() == rhs.GetOpaqueDeclContext();
+}
+
+
+bool
+lldb_private::operator != (const lldb_private::CompilerDeclContext &lhs, const lldb_private::CompilerDeclContext &rhs)
+{
+ return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDeclContext() != rhs.GetOpaqueDeclContext();
+}
Modified: lldb/trunk/source/Symbol/CompilerType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/CompilerType.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/CompilerType.cpp (original)
+++ lldb/trunk/source/Symbol/CompilerType.cpp Mon Aug 24 18:46:31 2015
@@ -397,14 +397,14 @@ CompilerType::GetTypeClass () const
}
void
-CompilerType::SetClangType (TypeSystem* type_system, void* type)
+CompilerType::SetCompilerType (TypeSystem* type_system, void* type)
{
m_type_system = type_system;
m_type = type;
}
void
-CompilerType::SetClangType (clang::ASTContext *ast, clang::QualType qual_type)
+CompilerType::SetCompilerType (clang::ASTContext *ast, clang::QualType qual_type)
{
m_type_system = ClangASTContext::GetASTContext(ast);
m_type = qual_type.getAsOpaquePtr();
@@ -536,15 +536,6 @@ CompilerType::GetTypedefedType () const
return CompilerType();
}
-//CompilerType
-//CompilerType::RemoveFastQualifiers () const
-//{
-// if (IsValid())
-// return m_type_system->RemoveFastQualifiers(m_type);
-// return CompilerType();
-//}
-
-
//----------------------------------------------------------------------
// Create related types using the current type's AST
//----------------------------------------------------------------------
@@ -553,7 +544,7 @@ CompilerType
CompilerType::GetBasicTypeFromAST (lldb::BasicType basic_type) const
{
if (IsValid())
- return m_type_system->GetBasicTypeFromAST(m_type, basic_type);
+ return m_type_system->GetBasicTypeFromAST(basic_type);
return CompilerType();
}
//----------------------------------------------------------------------
@@ -620,6 +611,12 @@ CompilerType::GetBasicTypeEnumeration ()
return eBasicTypeInvalid;
}
+void
+CompilerType::ForEachEnumerator (std::function <bool (const CompilerType &integer_type, const ConstString &name, const llvm::APSInt &value)> const &callback) const
+{
+ if (IsValid())
+ return m_type_system->ForEachEnumerator (m_type, callback);
+}
uint32_t
@@ -643,6 +640,38 @@ CompilerType::GetFieldAtIndex (size_t id
}
uint32_t
+CompilerType::GetNumDirectBaseClasses () const
+{
+ if (IsValid())
+ return m_type_system->GetNumDirectBaseClasses (m_type);
+ return 0;
+}
+
+uint32_t
+CompilerType::GetNumVirtualBaseClasses () const
+{
+ if (IsValid())
+ return m_type_system->GetNumVirtualBaseClasses (m_type);
+ return 0;
+}
+
+CompilerType
+CompilerType::GetDirectBaseClassAtIndex (size_t idx, uint32_t *bit_offset_ptr) const
+{
+ if (IsValid())
+ return m_type_system->GetDirectBaseClassAtIndex (m_type, idx, bit_offset_ptr);
+ return CompilerType();
+}
+
+CompilerType
+CompilerType::GetVirtualBaseClassAtIndex (size_t idx, uint32_t *bit_offset_ptr) const
+{
+ if (IsValid())
+ return m_type_system->GetVirtualBaseClassAtIndex (m_type, idx, bit_offset_ptr);
+ return CompilerType();
+}
+
+uint32_t
CompilerType::GetIndexOfFieldWithName (const char* name,
CompilerType* field_clang_type_ptr,
uint64_t *bit_offset_ptr,
Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Mon Aug 24 18:46:31 2015
@@ -489,27 +489,24 @@ Function::GetDisplayName () const
return m_mangled.GetDisplayDemangledName(GetLanguage());
}
-clang::DeclContext *
-Function::GetClangDeclContext()
+CompilerDeclContext
+Function::GetDeclContext()
{
- SymbolContext sc;
-
- CalculateSymbolContext (&sc);
-
- if (!sc.module_sp)
- return nullptr;
-
- SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
-
- if (!sym_vendor)
- return nullptr;
-
- SymbolFile *sym_file = sym_vendor->GetSymbolFile();
-
- if (!sym_file)
- return nullptr;
-
- return sym_file->GetClangDeclContextForTypeUID (sc, m_uid);
+ ModuleSP module_sp = CalculateSymbolContextModule ();
+
+ if (module_sp)
+ {
+ SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
+
+ if (sym_vendor)
+ {
+ SymbolFile *sym_file = sym_vendor->GetSymbolFile();
+
+ if (sym_file)
+ return sym_file->GetDeclContextForUID (GetID());
+ }
+ }
+ return CompilerDeclContext();
}
Type*
@@ -546,11 +543,11 @@ Function::GetType() const
}
CompilerType
-Function::GetClangType()
+Function::GetCompilerType()
{
Type *function_type = GetType();
if (function_type)
- return function_type->GetClangFullType();
+ return function_type->GetFullCompilerType ();
return CompilerType();
}
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Mon Aug 24 18:46:31 2015
@@ -649,22 +649,13 @@ SymbolContext::GetFunctionMethodInfo (ll
{
- Block *function_block = GetFunctionBlock ();
+ Block *function_block = GetFunctionBlock();
if (function_block)
{
- clang::DeclContext *decl_context = function_block->GetClangDeclContext();
-
- if (decl_context)
- {
- return ClangASTContext::GetClassMethodInfoForDeclContext (decl_context,
- language,
- is_instance_method,
- language_object_name);
- }
+ CompilerDeclContext decl_ctx = function_block->GetDeclContext();
+ if (decl_ctx)
+ return decl_ctx.IsClassMethod(&language, &is_instance_method, &language_object_name);
}
- language = eLanguageTypeUnknown;
- is_instance_method = false;
- language_object_name.Clear();
return false;
}
Modified: lldb/trunk/source/Symbol/SymbolFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolFile.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolFile.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolFile.cpp Mon Aug 24 18:46:31 2015
@@ -15,6 +15,8 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/VariableList.h"
using namespace lldb_private;
@@ -94,3 +96,52 @@ SymbolFile::GetTypeSystemForLanguage (ll
return m_obj_file->GetModule()->GetTypeSystemForLanguage (language);
}
+uint32_t
+SymbolFile::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
+{
+ sc_list.Clear();
+ return 0;
+}
+
+
+uint32_t
+SymbolFile::FindGlobalVariables (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, VariableList& variables)
+{
+ if (!append)
+ variables.Clear();
+ return 0;
+}
+
+
+uint32_t
+SymbolFile::FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
+{
+ if (!append)
+ variables.Clear();
+ return 0;
+}
+
+uint32_t
+SymbolFile::FindFunctions (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
+{
+ if (!append)
+ sc_list.Clear();
+ return 0;
+}
+
+uint32_t
+SymbolFile::FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list)
+{
+ if (!append)
+ sc_list.Clear();
+ return 0;
+}
+
+uint32_t
+SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeList& types)
+{
+ if (!append)
+ types.Clear();
+ return 0;
+}
+
Modified: lldb/trunk/source/Symbol/SymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp Mon Aug 24 18:46:31 2015
@@ -293,14 +293,14 @@ SymbolVendor::ResolveSymbolContext (cons
}
size_t
-SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, VariableList& variables)
+SymbolVendor::FindGlobalVariables (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, VariableList& variables)
{
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindGlobalVariables(name, namespace_decl, append, max_matches, variables);
+ return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx, append, max_matches, variables);
}
return 0;
}
@@ -319,14 +319,14 @@ SymbolVendor::FindGlobalVariables (const
}
size_t
-SymbolVendor::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
+SymbolVendor::FindFunctions(const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
{
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, append, sc_list);
+ return m_sym_file_ap->FindFunctions(name, parent_decl_ctx, name_type_mask, include_inlines, append, sc_list);
}
return 0;
}
@@ -346,14 +346,14 @@ SymbolVendor::FindFunctions(const Regula
size_t
-SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, TypeList& types)
+SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, TypeList& types)
{
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindTypes(sc, name, namespace_decl, append, max_matches, types);
+ return m_sym_file_ap->FindTypes(sc, name, parent_decl_ctx, append, max_matches, types);
}
if (!append)
types.Clear();
@@ -375,18 +375,18 @@ SymbolVendor::GetTypes (SymbolContextSco
return 0;
}
-ClangNamespaceDecl
-SymbolVendor::FindNamespace(const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *parent_namespace_decl)
+CompilerDeclContext
+SymbolVendor::FindNamespace(const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx)
{
- ClangNamespaceDecl namespace_decl;
+ CompilerDeclContext namespace_decl_ctx;
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
if (m_sym_file_ap.get())
- namespace_decl = m_sym_file_ap->FindNamespace (sc, name, parent_namespace_decl);
+ namespace_decl_ctx = m_sym_file_ap->FindNamespace (sc, name, parent_decl_ctx);
}
- return namespace_decl;
+ return namespace_decl_ctx;
}
void
Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Mon Aug 24 18:46:31 2015
@@ -178,7 +178,7 @@ Type::GetDescription (Stream *s, lldb::D
if (m_clang_type.IsValid())
{
*s << ", clang_type = \"";
- GetClangForwardType().DumpTypeDescription(s);
+ GetForwardCompilerType ().DumpTypeDescription(s);
*s << '"';
}
else if (m_encoding_uid != LLDB_INVALID_UID)
@@ -226,7 +226,7 @@ Type::Dump (Stream *s, bool show_context
if (m_clang_type.IsValid())
{
*s << ", clang_type = " << m_clang_type.GetOpaqueQualType() << ' ';
- GetClangForwardType().DumpTypeDescription (s);
+ GetForwardCompilerType ().DumpTypeDescription (s);
}
else if (m_encoding_uid != LLDB_INVALID_UID)
{
@@ -256,7 +256,7 @@ const ConstString &
Type::GetName()
{
if (!m_name)
- m_name = GetClangForwardType().GetConstTypeName();
+ m_name = GetForwardCompilerType ().GetConstTypeName();
return m_name;
}
@@ -291,7 +291,7 @@ Type::DumpValue
s->PutCString(") ");
}
- GetClangForwardType().DumpValue (exe_ctx,
+ GetForwardCompilerType ().DumpValue (exe_ctx,
s,
format == lldb::eFormatDefault ? GetFormat() : format,
data,
@@ -336,7 +336,7 @@ Type::GetByteSize()
if (encoding_type)
m_byte_size = encoding_type->GetByteSize();
if (m_byte_size == 0)
- m_byte_size = GetClangLayoutType().GetByteSize(nullptr);
+ m_byte_size = GetLayoutCompilerType ().GetByteSize(nullptr);
}
break;
@@ -355,13 +355,13 @@ Type::GetByteSize()
uint32_t
Type::GetNumChildren (bool omit_empty_base_classes)
{
- return GetClangForwardType().GetNumChildren(omit_empty_base_classes);
+ return GetForwardCompilerType ().GetNumChildren(omit_empty_base_classes);
}
bool
Type::IsAggregateType ()
{
- return GetClangForwardType().IsAggregateType();
+ return GetForwardCompilerType ().IsAggregateType();
}
lldb::TypeSP
@@ -382,7 +382,7 @@ Type::GetTypedefType()
lldb::Format
Type::GetFormat ()
{
- return GetClangForwardType().GetFormat();
+ return GetForwardCompilerType ().GetFormat();
}
@@ -391,7 +391,7 @@ lldb::Encoding
Type::GetEncoding (uint64_t &count)
{
// Make sure we resolve our type if it already hasn't been.
- return GetClangForwardType().GetEncoding(count);
+ return GetForwardCompilerType ().GetEncoding(count);
}
bool
@@ -502,7 +502,7 @@ Type::ResolveClangType (ResolveState cla
{
case eEncodingIsUID:
{
- CompilerType encoding_clang_type = encoding_type->GetClangForwardType();
+ CompilerType encoding_clang_type = encoding_type->GetForwardCompilerType ();
if (encoding_clang_type.IsValid())
{
m_clang_type = encoding_clang_type;
@@ -512,34 +512,34 @@ Type::ResolveClangType (ResolveState cla
break;
case eEncodingIsConstUID:
- m_clang_type = ClangASTContext::AddConstModifier(encoding_type->GetClangForwardType());
+ m_clang_type = ClangASTContext::AddConstModifier(encoding_type->GetForwardCompilerType ());
break;
case eEncodingIsRestrictUID:
- m_clang_type = ClangASTContext::AddRestrictModifier(encoding_type->GetClangForwardType());
+ m_clang_type = ClangASTContext::AddRestrictModifier(encoding_type->GetForwardCompilerType ());
break;
case eEncodingIsVolatileUID:
- m_clang_type = ClangASTContext::AddVolatileModifier(encoding_type->GetClangForwardType());
+ m_clang_type = ClangASTContext::AddVolatileModifier(encoding_type->GetForwardCompilerType ());
break;
case eEncodingIsTypedefUID:
- m_clang_type = ClangASTContext::CreateTypedefType (encoding_type->GetClangForwardType(),
+ m_clang_type = ClangASTContext::CreateTypedefType (encoding_type->GetForwardCompilerType (),
GetName().AsCString(),
- GetSymbolFile()->GetClangDeclContextContainingTypeUID(GetID()));
+ GetSymbolFile()->GetDeclContextContainingUID(GetID()));
m_name.Clear();
break;
case eEncodingIsPointerUID:
- m_clang_type = encoding_type->GetClangForwardType().GetPointerType();
+ m_clang_type = encoding_type->GetForwardCompilerType ().GetPointerType();
break;
case eEncodingIsLValueReferenceUID:
- m_clang_type = ClangASTContext::GetLValueReferenceType(encoding_type->GetClangForwardType());
+ m_clang_type = ClangASTContext::GetLValueReferenceType(encoding_type->GetForwardCompilerType ());
break;
case eEncodingIsRValueReferenceUID:
- m_clang_type = ClangASTContext::GetRValueReferenceType(encoding_type->GetClangForwardType());
+ m_clang_type = ClangASTContext::GetRValueReferenceType(encoding_type->GetForwardCompilerType ());
break;
default:
@@ -572,7 +572,7 @@ Type::ResolveClangType (ResolveState cla
case eEncodingIsTypedefUID:
m_clang_type = ClangASTContext::CreateTypedefType (void_clang_type,
GetName().AsCString(),
- GetSymbolFile()->GetClangDeclContextContainingTypeUID(GetID()));
+ GetSymbolFile()->GetDeclContextContainingUID(GetID()));
break;
case eEncodingIsPointerUID:
@@ -656,21 +656,21 @@ Type::GetEncodingMask ()
}
CompilerType
-Type::GetClangFullType ()
+Type::GetFullCompilerType ()
{
ResolveClangType(eResolveStateFull);
return m_clang_type;
}
CompilerType
-Type::GetClangLayoutType ()
+Type::GetLayoutCompilerType ()
{
ResolveClangType(eResolveStateLayout);
return m_clang_type;
}
CompilerType
-Type::GetClangForwardType ()
+Type::GetForwardCompilerType ()
{
ResolveClangType (eResolveStateForward);
return m_clang_type;
@@ -693,64 +693,14 @@ Type::Compare(const Type &a, const Type
if (a_uid > b_uid)
return 1;
return 0;
-// if (a.getQualType() == b.getQualType())
-// return 0;
-}
-
-
-#if 0 // START REMOVE
-// Move this into CompilerType
-void *
-Type::CreateClangPointerType (Type *type)
-{
- assert(type);
- return GetClangASTContext().CreatePointerType(type->GetClangForwardType());
-}
-
-void *
-Type::CreateClangTypedefType (Type *typedef_type, Type *base_type)
-{
- assert(typedef_type && base_type);
- return GetClangASTContext().CreateTypedefType (typedef_type->GetName().AsCString(),
- base_type->GetClangForwardType(),
- typedef_type->GetSymbolFile()->GetClangDeclContextContainingTypeUID(typedef_type->GetID()));
-}
-
-void *
-Type::CreateClangLValueReferenceType (Type *type)
-{
- assert(type);
- return GetClangASTContext().CreateLValueReferenceType(type->GetClangForwardType());
-}
-
-void *
-Type::CreateClangRValueReferenceType (Type *type)
-{
- assert(type);
- return GetClangASTContext().CreateRValueReferenceType (type->GetClangForwardType());
-}
-#endif // END REMOVE
-
-bool
-Type::IsRealObjCClass()
-{
- // For now we are just skipping ObjC classes that get made by hand from the runtime, because
- // those don't have any information. We could extend this to only return true for "full
- // definitions" if we can figure that out.
-
- if (ClangASTContext::IsObjCObjectOrInterfaceType(m_clang_type) && GetByteSize() != 0)
- return true;
- else
- return false;
}
ConstString
Type::GetQualifiedName ()
{
- return GetClangForwardType().GetConstTypeName();
+ return GetForwardCompilerType ().GetConstTypeName();
}
-
bool
Type::GetTypeScopeAndBasename (const char* &name_cstr,
std::string &scope,
@@ -1417,19 +1367,13 @@ TypeMemberFunctionImpl::GetArgumentAtInd
return CompilerType();
}
-TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
- const lldb_private::CompilerType& integer_type) :
- m_integer_type_sp(),
- m_name(),
- m_value(),
- m_valid(false)
+TypeEnumMemberImpl::TypeEnumMemberImpl (const lldb::TypeImplSP &integer_type_sp,
+ const ConstString &name,
+ const llvm::APSInt &value) :
+ m_integer_type_sp(integer_type_sp),
+ m_name(name),
+ m_value(value),
+ m_valid((bool)name && (bool)integer_type_sp)
{
- if (enum_member_decl)
- {
- m_integer_type_sp.reset(new TypeImpl(integer_type));
- m_name = ConstString(enum_member_decl->getNameAsString().c_str());
- m_value = enum_member_decl->getInitVal();
- m_valid = true;
- }
}
Modified: lldb/trunk/source/Symbol/TypeList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/TypeList.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/TypeList.cpp (original)
+++ lldb/trunk/source/Symbol/TypeList.cpp Mon Aug 24 18:46:31 2015
@@ -216,7 +216,7 @@ TypeList::RemoveMismatchedTypes (const s
if (type_class != eTypeClassAny)
{
- match_type_class = the_type->GetClangForwardType().GetTypeClass ();
+ match_type_class = the_type->GetForwardCompilerType ().GetTypeClass ();
if ((match_type_class & type_class) == 0)
continue;
}
@@ -305,7 +305,7 @@ TypeList::RemoveMismatchedTypes (TypeCla
for (pos = m_types.begin(); pos != end; ++pos)
{
Type* the_type = pos->second.get();
- TypeClass match_type_class = the_type->GetClangForwardType().GetTypeClass ();
+ TypeClass match_type_class = the_type->GetForwardCompilerType ().GetTypeClass ();
if (match_type_class & type_class)
matching_types.insert (*pos);
}
Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Mon Aug 24 18:46:31 2015
@@ -584,13 +584,13 @@ PrivateAutoCompleteMembers (StackFrame *
{
// We are in a type parsing child members
- const uint32_t num_bases = ClangASTContext::GetNumDirectBaseClasses(clang_type);
+ const uint32_t num_bases = clang_type.GetNumDirectBaseClasses();
if (num_bases > 0)
{
for (uint32_t i = 0; i < num_bases; ++i)
{
- CompilerType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(clang_type, i, nullptr));
+ CompilerType base_class_type = clang_type.GetDirectBaseClassAtIndex(i, nullptr);
PrivateAutoCompleteMembers (frame,
partial_member_name,
@@ -602,13 +602,13 @@ PrivateAutoCompleteMembers (StackFrame *
}
}
- const uint32_t num_vbases = ClangASTContext::GetNumVirtualBaseClasses(clang_type);
+ const uint32_t num_vbases = clang_type.GetNumVirtualBaseClasses();
if (num_vbases > 0)
{
for (uint32_t i = 0; i < num_vbases; ++i)
{
- CompilerType vbase_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(clang_type, i,nullptr));
+ CompilerType vbase_class_type = clang_type.GetVirtualBaseClassAtIndex(i,nullptr);
PrivateAutoCompleteMembers (frame,
partial_member_name,
@@ -888,7 +888,7 @@ PrivateAutoComplete (StackFrame *frame,
Type *variable_type = variable->GetType();
if (variable_type)
{
- CompilerType variable_clang_type (variable_type->GetClangForwardType());
+ CompilerType variable_clang_type (variable_type->GetForwardCompilerType ());
PrivateAutoComplete (frame,
remaining_partial_path,
prefix_path + token, // Anything that has been resolved already will be in here
Modified: lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ObjCLanguageRuntime.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Target/ObjCLanguageRuntime.cpp (original)
+++ lldb/trunk/source/Target/ObjCLanguageRuntime.cpp Mon Aug 24 18:46:31 2015
@@ -136,7 +136,7 @@ ObjCLanguageRuntime::LookupInCompleteCla
{
TypeSP type_sp (types.GetTypeAtIndex(i));
- if (ClangASTContext::IsObjCObjectOrInterfaceType(type_sp->GetClangForwardType()))
+ if (ClangASTContext::IsObjCObjectOrInterfaceType(type_sp->GetForwardCompilerType ()))
{
if (type_sp->IsCompleteObjCClass())
{
@@ -549,7 +549,7 @@ ObjCLanguageRuntime::GetClassDescriptor
// if we get an invalid VO (which might still happen when playing around
// with pointers returned by the expression parser, don't consider this
// a valid ObjC object)
- if (valobj.GetClangType().IsValid())
+ if (valobj.GetCompilerType().IsValid())
{
addr_t isa_pointer = valobj.GetPointerValue();
if (isa_pointer != LLDB_INVALID_ADDRESS)
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Mon Aug 24 18:46:31 2015
@@ -713,7 +713,7 @@ StackFrame::GetValueForVariableExpressio
{
// Make sure we aren't trying to deref an objective
// C ivar if this is not allowed
- const uint32_t pointer_type_flags = valobj_sp->GetClangType().GetTypeInfo (NULL);
+ const uint32_t pointer_type_flags = valobj_sp->GetCompilerType().GetTypeInfo (NULL);
if ((pointer_type_flags & eTypeIsObjC) &&
(pointer_type_flags & eTypeIsPointer))
{
@@ -827,7 +827,7 @@ StackFrame::GetValueForVariableExpressio
if (end && *end == ']'
&& *(end-1) != '[') // this code forces an error in the case of arr[]. as bitfield[] is not a good syntax we're good to go
{
- if (valobj_sp->GetClangType().IsPointerToScalarType() && deref)
+ if (valobj_sp->GetCompilerType().IsPointerToScalarType() && deref)
{
// what we have is *ptr[low]. the most similar C++ syntax is to deref ptr
// and extract bit low out of it. reading array item low
@@ -845,7 +845,7 @@ StackFrame::GetValueForVariableExpressio
valobj_sp = temp;
deref = false;
}
- else if (valobj_sp->GetClangType().IsArrayOfScalarType() && deref)
+ else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() && deref)
{
// what we have is *arr[low]. the most similar C++ syntax is to get arr[0]
// (an operation that is equivalent to deref-ing arr)
@@ -870,9 +870,9 @@ StackFrame::GetValueForVariableExpressio
{
bool is_objc_pointer = true;
- if (valobj_sp->GetClangType().GetMinimumLanguage() != eLanguageTypeObjC)
+ if (valobj_sp->GetCompilerType().GetMinimumLanguage() != eLanguageTypeObjC)
is_objc_pointer = false;
- else if (!valobj_sp->GetClangType().IsPointerType())
+ else if (!valobj_sp->GetCompilerType().IsPointerType())
is_objc_pointer = false;
if (no_synth_child && is_objc_pointer)
@@ -929,7 +929,7 @@ StackFrame::GetValueForVariableExpressio
}
}
}
- else if (valobj_sp->GetClangType().IsArrayType (NULL, NULL, &is_incomplete_array))
+ else if (valobj_sp->GetCompilerType().IsArrayType (NULL, NULL, &is_incomplete_array))
{
// Pass false to dynamic_value here so we can tell the difference between
// no dynamic value and no member of this type...
@@ -946,7 +946,7 @@ StackFrame::GetValueForVariableExpressio
var_expr_path_strm.GetString().c_str());
}
}
- else if (valobj_sp->GetClangType().IsScalarType())
+ else if (valobj_sp->GetCompilerType().IsScalarType())
{
// this is a bitfield asking to display just one bit
child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(child_index, child_index, true);
@@ -1029,7 +1029,7 @@ StackFrame::GetValueForVariableExpressio
final_index = temp;
}
- if (valobj_sp->GetClangType().IsPointerToScalarType() && deref)
+ if (valobj_sp->GetCompilerType().IsPointerToScalarType() && deref)
{
// what we have is *ptr[low-high]. the most similar C++ syntax is to deref ptr
// and extract bits low thru high out of it. reading array items low thru high
@@ -1047,7 +1047,7 @@ StackFrame::GetValueForVariableExpressio
valobj_sp = temp;
deref = false;
}
- else if (valobj_sp->GetClangType().IsArrayOfScalarType() && deref)
+ else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() && deref)
{
// what we have is *arr[low-high]. the most similar C++ syntax is to get arr[0]
// (an operation that is equivalent to deref-ing arr)
Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Mon Aug 24 18:46:31 2015
@@ -1923,7 +1923,7 @@ Thread::ReturnFromFrame (lldb::StackFram
Type *function_type = sc.function->GetType();
if (function_type)
{
- CompilerType return_type = sc.function->GetClangType().GetFunctionReturnType();
+ CompilerType return_type = sc.function->GetCompilerType().GetFunctionReturnType();
if (return_type)
{
StreamString s;
Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Mon Aug 24 18:46:31 2015
@@ -533,7 +533,7 @@ ThreadPlanStepOut::CalculateReturnValue
if (m_immediate_step_from_function != NULL)
{
- CompilerType return_clang_type = m_immediate_step_from_function->GetClangType().GetFunctionReturnType();
+ CompilerType return_clang_type = m_immediate_step_from_function->GetCompilerType().GetFunctionReturnType();
if (return_clang_type)
{
lldb::ABISP abi_sp = m_thread.GetProcess()->GetABI();
Modified: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=245905&r1=245904&r2=245905&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Mon Aug 24 18:46:31 2015
@@ -240,7 +240,7 @@ ThreadPlanAssemblyTracer::Log ()
Value value;
value.SetValueType (Value::eValueTypeScalar);
// value.SetContext (Value::eContextTypeClangType, intptr_type.GetOpaqueQualType());
- value.SetClangType (intptr_type);
+ value.SetCompilerType (intptr_type);
value_list.PushValue (value);
}
More information about the lldb-commits
mailing list