ClangASTType is now CompilerType.
This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc).
llvm-svn: 244689
diff --git a/lldb/source/Expression/ASTDumper.cpp b/lldb/source/Expression/ASTDumper.cpp
index 80faeb3..2034b4f 100644
--- a/lldb/source/Expression/ASTDumper.cpp
+++ b/lldb/source/Expression/ASTDumper.cpp
@@ -10,7 +10,7 @@
#include "lldb/Core/Log.h"
#include "lldb/Expression/ASTDumper.h"
#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ClangASTType.h"
+#include "lldb/Symbol/CompilerType.h"
#include "llvm/Support/raw_ostream.h"
@@ -80,7 +80,7 @@
m_dump = clang::QualType::getFromOpaquePtr(type).getAsString();
}
-ASTDumper::ASTDumper (const ClangASTType &clang_type)
+ASTDumper::ASTDumper (const CompilerType &clang_type)
{
m_dump = ClangASTContext::GetQualType(clang_type).getAsString();
}
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 4632d4f..fb1dcb1 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -272,7 +272,7 @@
if (!type)
continue;
- ClangASTType clang_type (type->GetClangFullType());
+ CompilerType clang_type (type->GetClangFullType());
if (!clang_type)
continue;
@@ -311,7 +311,7 @@
if (!type)
continue;
- ClangASTType clang_type (type->GetClangFullType());
+ CompilerType clang_type (type->GetClangFullType());
if (!clang_type)
continue;
@@ -761,9 +761,9 @@
(name_string ? name_string : "<anonymous>"));
}
- ClangASTType full_type = type_sp->GetClangFullType();
+ CompilerType full_type = type_sp->GetClangFullType();
- ClangASTType copied_clang_type (GuardedCopyType(full_type));
+ CompilerType copied_clang_type (GuardedCopyType(full_type));
if (!copied_clang_type)
{
@@ -1876,14 +1876,14 @@
return dyn_cast<NamespaceDecl>(copied_decl);
}
-ClangASTType
-ClangASTSource::GuardedCopyType (const ClangASTType &src_type)
+CompilerType
+ClangASTSource::GuardedCopyType (const CompilerType &src_type)
{
ClangASTMetrics::RegisterLLDBImport();
ClangASTContext* src_ast = src_type.GetTypeSystem()->AsClangASTContext();
if (!src_ast)
- return ClangASTType();
+ return CompilerType();
SetImportInProgress(true);
@@ -1894,13 +1894,13 @@
if (copied_qual_type.getAsOpaquePtr() && copied_qual_type->getCanonicalTypeInternal().isNull())
// this shouldn't happen, but we're hardening because the AST importer seems to be generating bad types
// on occasion.
- return ClangASTType();
+ return CompilerType();
- return ClangASTType(m_ast_context, copied_qual_type);
+ return CompilerType(m_ast_context, copied_qual_type);
}
clang::NamedDecl *
-NameSearchContext::AddVarDecl(const ClangASTType &type)
+NameSearchContext::AddVarDecl(const CompilerType &type)
{
assert (type && "Type for variable must be valid!");
@@ -1929,7 +1929,7 @@
}
clang::NamedDecl *
-NameSearchContext::AddFunDecl (const ClangASTType &type, bool extern_c)
+NameSearchContext::AddFunDecl (const CompilerType &type, bool extern_c)
{
assert (type && "Type for variable must be valid!");
@@ -2030,11 +2030,11 @@
ArrayRef<QualType>(), // argument types
proto_info));
- return AddFunDecl(ClangASTType (m_ast_source.m_ast_context, generic_function_type), true);
+ return AddFunDecl(CompilerType (m_ast_source.m_ast_context, generic_function_type), true);
}
clang::NamedDecl *
-NameSearchContext::AddTypeDecl(const ClangASTType &clang_type)
+NameSearchContext::AddTypeDecl(const CompilerType &clang_type)
{
if (clang_type)
{
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index b719e06..d2c4f02 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -1103,7 +1103,7 @@
if (!this_type)
return;
- ClangASTType pointee_type = this_type->GetClangForwardType().GetPointeeType();
+ CompilerType pointee_type = this_type->GetClangForwardType().GetPointeeType();
if (pointee_type.IsValid())
{
@@ -1220,7 +1220,7 @@
if (!self_type)
return;
- ClangASTType self_clang_type = self_type->GetClangFullType();
+ CompilerType self_clang_type = self_type->GetClangFullType();
if (ClangASTContext::IsObjCClassType(self_clang_type))
{
@@ -1632,7 +1632,7 @@
return false;
}
- ClangASTType var_clang_type = var_type->GetClangFullType();
+ CompilerType var_clang_type = var_type->GetClangFullType();
if (!var_clang_type)
{
@@ -1673,7 +1673,7 @@
}
}
- ClangASTType type_to_use = GuardedCopyType(var_clang_type);
+ CompilerType type_to_use = GuardedCopyType(var_clang_type);
if (!type_to_use)
{
@@ -1930,7 +1930,7 @@
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
- ClangASTType clang_type = ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (m_ast_context,
+ CompilerType clang_type = ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (m_ast_context,
reg_info->encoding,
reg_info->byte_size * 8);
@@ -1980,7 +1980,7 @@
NamedDecl *function_decl = NULL;
Address fun_address;
- ClangASTType function_clang_type;
+ CompilerType function_clang_type;
bool is_indirect_function = false;
@@ -2006,7 +2006,7 @@
fun_address = function->GetAddressRange().GetBaseAddress();
- ClangASTType copied_function_type = GuardedCopyType(function_clang_type);
+ CompilerType copied_function_type = GuardedCopyType(function_clang_type);
if (copied_function_type)
{
function_decl = context.AddFunDecl(copied_function_type);
@@ -2105,7 +2105,7 @@
ClangExpressionDeclMap::CopyClassType(TypeFromUser &ut,
unsigned int current_id)
{
- ClangASTType copied_clang_type = GuardedCopyType(ut);
+ CompilerType copied_clang_type = GuardedCopyType(ut);
if (!copied_clang_type)
{
@@ -2119,10 +2119,10 @@
if (copied_clang_type.IsAggregateType() && copied_clang_type.GetCompleteType ())
{
- ClangASTType void_clang_type = ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid);
- ClangASTType void_ptr_clang_type = void_clang_type.GetPointerType();
+ CompilerType void_clang_type = ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid);
+ CompilerType void_ptr_clang_type = void_clang_type.GetPointerType();
- ClangASTType method_type = ClangASTContext::CreateFunctionType (m_ast_context,
+ CompilerType method_type = ClangASTContext::CreateFunctionType (m_ast_context,
void_clang_type,
&void_ptr_clang_type,
1,
@@ -2157,7 +2157,7 @@
TypeFromUser &ut,
unsigned int current_id)
{
- ClangASTType copied_clang_type = GuardedCopyType(ut);
+ CompilerType copied_clang_type = GuardedCopyType(ut);
if (!copied_clang_type)
{
diff --git a/lldb/source/Expression/ClangExpressionVariable.cpp b/lldb/source/Expression/ClangExpressionVariable.cpp
index e86016e..00da5b8 100644
--- a/lldb/source/Expression/ClangExpressionVariable.cpp
+++ b/lldb/source/Expression/ClangExpressionVariable.cpp
@@ -80,14 +80,14 @@
return m_frozen_sp->GetValue().SetContext (Value::eContextTypeRegisterInfo, const_cast<RegisterInfo *>(reg_info));
}
-ClangASTType
+CompilerType
ClangExpressionVariable::GetClangType()
{
return m_frozen_sp->GetClangType();
}
void
-ClangExpressionVariable::SetClangType(const ClangASTType &clang_type)
+ClangExpressionVariable::SetClangType(const CompilerType &clang_type)
{
m_frozen_sp->GetValue().SetClangType(clang_type);
}
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index b438dac..572aec5 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -52,7 +52,7 @@
ClangFunction::ClangFunction
(
ExecutionContextScope &exe_scope,
- const ClangASTType &return_type,
+ const CompilerType &return_type,
const Address& functionAddress,
const ValueList &arg_value_list,
const char *name
@@ -151,7 +151,7 @@
uint32_t num_args = UINT32_MAX;
bool trust_function = false;
// GetArgumentCount returns -1 for an unprototyped function.
- ClangASTType function_clang_type;
+ CompilerType function_clang_type;
if (m_function_ptr)
{
function_clang_type = m_function_ptr->GetClangType();
@@ -181,7 +181,7 @@
}
else
{
- ClangASTType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType ();
+ CompilerType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType ();
if (clang_qual_type)
{
type_name = clang_qual_type.GetTypeName().AsCString("");
@@ -449,7 +449,7 @@
lldb::ThreadPlanSP new_plan_sp (new ThreadPlanCallFunction (*thread,
wrapper_address,
- ClangASTType(),
+ CompilerType(),
args,
options));
new_plan_sp->SetIsMasterPlan(true);
@@ -462,7 +462,7 @@
{
// Read the return value - it is the last field in the struct:
// FIXME: How does clang tell us there's no return value? We need to handle that case.
- // FIXME: Create our ThreadPlanCallFunction with the return ClangASTType, and then use GetReturnValueObject
+ // FIXME: Create our ThreadPlanCallFunction with the return CompilerType, and then use GetReturnValueObject
// to fetch the value. That way we can fetch any values we need.
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 290b093..0db194c 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -305,7 +305,7 @@
return;
}
- ClangASTType self_clang_type = self_type->GetClangForwardType();
+ CompilerType self_clang_type = self_type->GetClangForwardType();
if (!self_clang_type)
{
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index 9db8278..39870b8 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -34,7 +34,7 @@
#include "lldb/Expression/IRInterpreter.h"
#include "lldb/Host/Endian.h"
#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ClangASTType.h"
+#include "lldb/Symbol/CompilerType.h"
#include "lldb/Target/CPPLanguageRuntime.h"
#include <map>
@@ -1509,7 +1509,7 @@
if (value_decl == NULL)
return false;
- lldb_private::ClangASTType clang_type(&value_decl->getASTContext(), value_decl->getType());
+ lldb_private::CompilerType clang_type(&value_decl->getASTContext(), value_decl->getType());
const Type *value_type = NULL;
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp
index ef01fee..3fb9036 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -48,7 +48,7 @@
}
void
-Materializer::Entity::SetSizeAndAlignmentFromType (ClangASTType &type)
+Materializer::Entity::SetSizeAndAlignmentFromType (CompilerType &type)
{
m_size = type.GetByteSize(nullptr);