summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-12-05 21:24:42 +0000
committerGreg Clayton <gclayton@apple.com>2012-12-05 21:24:42 +0000
commitb43165b7a5d59d8178dc803ec0351d3a62a38946 (patch)
tree53a13b3531ea6dcbc86f6ebac6f06e5f1ef7398f /lldb
parent0a471ea66c3c1b6b9183987cb4248af2ca216164 (diff)
downloadbcm5719-llvm-b43165b7a5d59d8178dc803ec0351d3a62a38946.tar.gz
bcm5719-llvm-b43165b7a5d59d8178dc803ec0351d3a62a38946.zip
<rdar://problem/12749733>
Always allows getting builtin types by name even if there is no backing debug information. llvm-svn: 169424
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/API/SBModule.h2
-rw-r--r--lldb/include/lldb/API/SBTarget.h3
-rw-r--r--lldb/include/lldb/Core/Module.h5
-rw-r--r--lldb/include/lldb/Symbol/ClangASTType.h9
-rw-r--r--lldb/scripts/Python/interface/SBModule.i2
-rw-r--r--lldb/scripts/Python/interface/SBTarget.i3
-rw-r--r--lldb/source/API/SBModule.cpp51
-rw-r--r--lldb/source/API/SBTarget.cpp73
-rw-r--r--lldb/source/API/SBType.cpp108
-rw-r--r--lldb/source/Core/Module.cpp13
-rw-r--r--lldb/source/Symbol/ClangASTType.cpp193
11 files changed, 316 insertions, 146 deletions
diff --git a/lldb/include/lldb/API/SBModule.h b/lldb/include/lldb/API/SBModule.h
index 48c5b04244e..d2e9903fd67 100644
--- a/lldb/include/lldb/API/SBModule.h
+++ b/lldb/include/lldb/API/SBModule.h
@@ -181,6 +181,8 @@ public:
lldb::SBTypeList
FindTypes (const char* type);
+ lldb::SBType
+ GetBasicType(lldb::BasicType type);
//------------------------------------------------------------------
/// Get the module version numbers.
diff --git a/lldb/include/lldb/API/SBTarget.h b/lldb/include/lldb/API/SBTarget.h
index edc36d149a1..5adc8bec0f9 100644
--- a/lldb/include/lldb/API/SBTarget.h
+++ b/lldb/include/lldb/API/SBTarget.h
@@ -719,6 +719,9 @@ public:
lldb::SBTypeList
FindTypes (const char* type);
+ lldb::SBType
+ GetBasicType(lldb::BasicType type);
+
SBSourceManager
GetSourceManager();
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index 23730334332..4022af5a795 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -408,6 +408,11 @@ public:
uint32_t max_matches,
TypeList& types);
+ lldb::TypeSP
+ FindFirstType (const SymbolContext& sc,
+ const ConstString &type_name,
+ bool exact_match);
+
//------------------------------------------------------------------
/// Find types by name that are in a namespace. This function is
/// used by the expression parser when searches need to happen in
diff --git a/lldb/include/lldb/Symbol/ClangASTType.h b/lldb/include/lldb/Symbol/ClangASTType.h
index a65810704f3..8a10f792323 100644
--- a/lldb/include/lldb/Symbol/ClangASTType.h
+++ b/lldb/include/lldb/Symbol/ClangASTType.h
@@ -82,6 +82,15 @@ public:
ConstString
GetConstQualifiedTypeName ();
+ static lldb::BasicType
+ GetBasicTypeEnumeration (const ConstString &name);
+
+ static ClangASTType
+ GetBasicType (clang::ASTContext *ast, lldb::BasicType type);
+
+ static ClangASTType
+ GetBasicType (clang::ASTContext *ast, const ConstString &name);
+
static ConstString
GetConstTypeName (clang::ASTContext *ast,
lldb::clang_type_t clang_type);
diff --git a/lldb/scripts/Python/interface/SBModule.i b/lldb/scripts/Python/interface/SBModule.i
index b98afdecde9..ee2d3b42c44 100644
--- a/lldb/scripts/Python/interface/SBModule.i
+++ b/lldb/scripts/Python/interface/SBModule.i
@@ -222,6 +222,8 @@ public:
lldb::SBTypeList
FindTypes (const char* type);
+ lldb::SBType
+ GetBasicType(lldb::BasicType type);
%feature("docstring", "
//------------------------------------------------------------------
diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i
index bc4c2289745..9685c94fcc1 100644
--- a/lldb/scripts/Python/interface/SBTarget.i
+++ b/lldb/scripts/Python/interface/SBTarget.i
@@ -560,6 +560,9 @@ public:
lldb::SBTypeList
FindTypes (const char* type);
+ lldb::SBType
+ GetBasicType(lldb::BasicType type);
+
lldb::SBSourceManager
GetSourceManager ();
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 933e803c270..f0c916ea048 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -488,27 +488,29 @@ SBModule::FindFirstType (const char *name_cstr)
if (name_cstr && module_sp)
{
SymbolContext sc;
- TypeList type_list;
- uint32_t num_matches = 0;
const bool exact_match = false;
ConstString name(name_cstr);
- num_matches = module_sp->FindTypes (sc,
- name,
- exact_match,
- 1,
- type_list);
+ sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));
- if (num_matches)
- sb_type = lldb::SBType(type_list.GetTypeAtIndex(0));
+ if (!sb_type.IsValid())
+ sb_type = SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
}
return sb_type;
}
+lldb::SBType
+SBModule::GetBasicType(lldb::BasicType type)
+{
+ ModuleSP module_sp (GetSP ());
+ if (module_sp)
+ return SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), type));
+ return SBType();
+}
+
lldb::SBTypeList
SBModule::FindTypes (const char *type)
{
-
SBTypeList retval;
ModuleSP module_sp (GetSP ());
@@ -517,20 +519,27 @@ SBModule::FindTypes (const char *type)
SymbolContext sc;
TypeList type_list;
const bool exact_match = false;
- uint32_t num_matches = 0;
ConstString name(type);
+ const uint32_t num_matches = module_sp->FindTypes (sc,
+ name,
+ exact_match,
+ UINT32_MAX,
+ type_list);
- num_matches = module_sp->FindTypes (sc,
- name,
- exact_match,
- UINT32_MAX,
- type_list);
-
- for (size_t idx = 0; idx < num_matches; idx++)
+ if (num_matches > 0)
+ {
+ for (size_t idx = 0; idx < num_matches; idx++)
+ {
+ TypeSP type_sp (type_list.GetTypeAtIndex(idx));
+ if (type_sp)
+ retval.Append(SBType(type_sp));
+ }
+ }
+ else
{
- TypeSP type_sp (type_list.GetTypeAtIndex(idx));
- if (type_sp)
- retval.Append(SBType(type_sp));
+ SBType sb_type(ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
+ if (sb_type.IsValid())
+ retval.Append(sb_type);
}
}
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 2020eadda5e..0ce361cb54d 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -2064,52 +2064,87 @@ SBTarget::FindFunctions (const char *name, uint32_t name_type_mask)
}
lldb::SBType
-SBTarget::FindFirstType (const char* type)
+SBTarget::FindFirstType (const char* typename_cstr)
{
TargetSP target_sp(GetSP());
- if (type && target_sp)
+ if (typename_cstr && typename_cstr[0] && target_sp)
{
- size_t count = target_sp->GetImages().GetSize();
+ ConstString const_typename(typename_cstr);
+ SymbolContext sc;
+ const bool exact_match = false;
+
+ const ModuleList &module_list = target_sp->GetImages();
+ size_t count = module_list.GetSize();
for (size_t idx = 0; idx < count; idx++)
{
- SBType found_at_idx = GetModuleAtIndex(idx).FindFirstType(type);
-
- if (found_at_idx.IsValid())
- return found_at_idx;
+ ModuleSP module_sp (module_list.GetModuleAtIndex(idx));
+ if (module_sp)
+ {
+ TypeSP type_sp (module_sp->FindFirstType(sc, const_typename, exact_match));
+ if (type_sp)
+ return SBType(type_sp);
+ }
}
+
+ // No matches, search for basic typename matches
+ ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+ if (clang_ast)
+ return SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), const_typename));
+ }
+ return SBType();
+}
+
+SBType
+SBTarget::GetBasicType(lldb::BasicType type)
+{
+ TargetSP target_sp(GetSP());
+ if (target_sp)
+ {
+ ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+ if (clang_ast)
+ return SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), type));
}
return SBType();
}
+
lldb::SBTypeList
-SBTarget::FindTypes (const char* type)
+SBTarget::FindTypes (const char* typename_cstr)
{
-
- SBTypeList retval;
-
+ SBTypeList sb_type_list;
TargetSP target_sp(GetSP());
- if (type && target_sp)
+ if (typename_cstr && typename_cstr[0] && target_sp)
{
ModuleList& images = target_sp->GetImages();
- ConstString name_const(type);
+ ConstString const_typename(typename_cstr);
bool exact_match = false;
SymbolContext sc;
TypeList type_list;
uint32_t num_matches = images.FindTypes (sc,
- name_const,
+ const_typename,
exact_match,
UINT32_MAX,
type_list);
- for (size_t idx = 0; idx < num_matches; idx++)
+ if (num_matches > 0)
+ {
+ for (size_t idx = 0; idx < num_matches; idx++)
+ {
+ TypeSP type_sp (type_list.GetTypeAtIndex(idx));
+ if (type_sp)
+ sb_type_list.Append(SBType(type_sp));
+ }
+ }
+ else
{
- TypeSP type_sp (type_list.GetTypeAtIndex(idx));
- if (type_sp)
- retval.Append(SBType(type_sp));
+ // No matches, search for basic typename matches
+ ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+ if (clang_ast)
+ sb_type_list.Append (SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), const_typename)));
}
}
- return retval;
+ return sb_type_list;
}
SBValueList
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 7387ed3097d..29c56a5b65e 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -285,111 +285,9 @@ SBType::GetBasicType()
SBType
SBType::GetBasicType(lldb::BasicType type)
{
- if (!IsValid())
- return SBType();
-
- clang::QualType base_type_qual;
-
- switch (type)
- {
- case eBasicTypeVoid:
- base_type_qual = m_opaque_sp->GetASTContext()->VoidTy;
- break;
- case eBasicTypeChar:
- base_type_qual = m_opaque_sp->GetASTContext()->CharTy;
- break;
- case eBasicTypeSignedChar:
- base_type_qual = m_opaque_sp->GetASTContext()->SignedCharTy;
- break;
- case eBasicTypeUnsignedChar:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedCharTy;
- break;
- case eBasicTypeWChar:
- base_type_qual = m_opaque_sp->GetASTContext()->getWCharType();
- break;
- case eBasicTypeSignedWChar:
- base_type_qual = m_opaque_sp->GetASTContext()->getSignedWCharType();
- break;
- case eBasicTypeUnsignedWChar:
- base_type_qual = m_opaque_sp->GetASTContext()->getUnsignedWCharType();
- break;
- case eBasicTypeChar16:
- base_type_qual = m_opaque_sp->GetASTContext()->Char16Ty;
- break;
- case eBasicTypeChar32:
- base_type_qual = m_opaque_sp->GetASTContext()->Char32Ty;
- break;
- case eBasicTypeShort:
- base_type_qual = m_opaque_sp->GetASTContext()->ShortTy;
- break;
- case eBasicTypeUnsignedShort:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedShortTy;
- break;
- case eBasicTypeInt:
- base_type_qual = m_opaque_sp->GetASTContext()->IntTy;
- break;
- case eBasicTypeUnsignedInt:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedIntTy;
- break;
- case eBasicTypeLong:
- base_type_qual = m_opaque_sp->GetASTContext()->LongTy;
- break;
- case eBasicTypeUnsignedLong:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongTy;
- break;
- case eBasicTypeLongLong:
- base_type_qual = m_opaque_sp->GetASTContext()->LongLongTy;
- break;
- case eBasicTypeUnsignedLongLong:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongLongTy;
- break;
- case eBasicTypeInt128:
- base_type_qual = m_opaque_sp->GetASTContext()->Int128Ty;
- break;
- case eBasicTypeUnsignedInt128:
- base_type_qual = m_opaque_sp->GetASTContext()->UnsignedInt128Ty;
- break;
- case eBasicTypeBool:
- base_type_qual = m_opaque_sp->GetASTContext()->BoolTy;
- break;
- case eBasicTypeHalf:
- base_type_qual = m_opaque_sp->GetASTContext()->HalfTy;
- break;
- case eBasicTypeFloat:
- base_type_qual = m_opaque_sp->GetASTContext()->FloatTy;
- break;
- case eBasicTypeDouble:
- base_type_qual = m_opaque_sp->GetASTContext()->DoubleTy;
- break;
- case eBasicTypeLongDouble:
- base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleTy;
- break;
- case eBasicTypeFloatComplex:
- base_type_qual = m_opaque_sp->GetASTContext()->FloatComplexTy;
- break;
- case eBasicTypeDoubleComplex:
- base_type_qual = m_opaque_sp->GetASTContext()->DoubleComplexTy;
- break;
- case eBasicTypeLongDoubleComplex:
- base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleComplexTy;
- break;
- case eBasicTypeObjCID:
- base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinIdTy;
- break;
- case eBasicTypeObjCClass:
- base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinClassTy;
- break;
- case eBasicTypeObjCSel:
- base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinSelTy;
- break;
- case eBasicTypeNullPtr:
- base_type_qual = m_opaque_sp->GetASTContext()->NullPtrTy;
- break;
- default:
- return SBType();
- }
-
- return SBType(ClangASTType(m_opaque_sp->GetASTContext(), base_type_qual.getAsOpaquePtr()));
+ if (IsValid())
+ return SBType (ClangASTType::GetBasicType (m_opaque_sp->GetASTContext(), type));
+ return SBType();
}
uint32_t
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index ebb2f545d89..22d03e38bcf 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -690,6 +690,19 @@ Module::FindTypesInNamespace (const SymbolContext& sc,
return FindTypes_Impl(sc, type_name, namespace_decl, append, max_matches, type_list);
}
+lldb::TypeSP
+Module::FindFirstType (const SymbolContext& sc,
+ const ConstString &name,
+ bool exact_match)
+{
+ TypeList type_list;
+ const uint32_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
+ if (num_matches)
+ return type_list.GetTypeAtIndex(0);
+ return TypeSP();
+}
+
+
uint32_t
Module::FindTypes (const SymbolContext& sc,
const ConstString &name,
diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp
index 43ba32826e4..8c4ac4fb680 100644
--- a/lldb/source/Symbol/ClangASTType.cpp
+++ b/lldb/source/Symbol/ClangASTType.cpp
@@ -1,4 +1,4 @@
-//===-- ClangASTType.cpp ---------------------------------------------*- C++ -*-===//
+//===-- ClangASTType.cpp ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -36,10 +36,13 @@
#include "lldb/Core/Scalar.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamString.h"
+#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
+#include <mutex>
+
using namespace lldb;
using namespace lldb_private;
@@ -1787,3 +1790,191 @@ lldb_private::operator != (const lldb_private::ClangASTType &lhs, const lldb_pri
{
return lhs.GetASTContext() != rhs.GetASTContext() || lhs.GetOpaqueQualType() != rhs.GetOpaqueQualType();
}
+
+lldb::BasicType
+ClangASTType::GetBasicTypeEnumeration (const ConstString &name)
+{
+ if (name)
+ {
+ typedef UniqueCStringMap<lldb::BasicType> TypeNameToBasicTypeMap;
+ static TypeNameToBasicTypeMap g_type_map;
+ static std::once_flag g_once_flag;
+ std::call_once(g_once_flag, [](){
+ // "void"
+ g_type_map.Append(ConstString("void").GetCString(), eBasicTypeVoid);
+
+ // "char"
+ g_type_map.Append(ConstString("char").GetCString(), eBasicTypeChar);
+ g_type_map.Append(ConstString("signed char").GetCString(), eBasicTypeSignedChar);
+ g_type_map.Append(ConstString("unsigned char").GetCString(), eBasicTypeUnsignedChar);
+ g_type_map.Append(ConstString("wchar_t").GetCString(), eBasicTypeWChar);
+ g_type_map.Append(ConstString("signed wchar_t").GetCString(), eBasicTypeSignedWChar);
+ g_type_map.Append(ConstString("unsigned wchar_t").GetCString(), eBasicTypeUnsignedWChar);
+ // "short"
+ g_type_map.Append(ConstString("short").GetCString(), eBasicTypeShort);
+ g_type_map.Append(ConstString("short int").GetCString(), eBasicTypeShort);
+ g_type_map.Append(ConstString("unsigned short").GetCString(), eBasicTypeUnsignedShort);
+ g_type_map.Append(ConstString("unsigned short int").GetCString(), eBasicTypeUnsignedShort);
+
+ // "int"
+ g_type_map.Append(ConstString("int").GetCString(), eBasicTypeInt);
+ g_type_map.Append(ConstString("signed int").GetCString(), eBasicTypeInt);
+ g_type_map.Append(ConstString("unsigned int").GetCString(), eBasicTypeUnsignedInt);
+ g_type_map.Append(ConstString("unsigned").GetCString(), eBasicTypeUnsignedInt);
+
+ // "long"
+ g_type_map.Append(ConstString("long").GetCString(), eBasicTypeLong);
+ g_type_map.Append(ConstString("long int").GetCString(), eBasicTypeLong);
+ g_type_map.Append(ConstString("unsigned long").GetCString(), eBasicTypeUnsignedLong);
+ g_type_map.Append(ConstString("unsigned long int").GetCString(), eBasicTypeUnsignedLong);
+
+ // "long long"
+ g_type_map.Append(ConstString("long long").GetCString(), eBasicTypeLongLong);
+ g_type_map.Append(ConstString("long long int").GetCString(), eBasicTypeLongLong);
+ g_type_map.Append(ConstString("unsigned long long").GetCString(), eBasicTypeUnsignedLongLong);
+ g_type_map.Append(ConstString("unsigned long long int").GetCString(), eBasicTypeUnsignedLongLong);
+
+ // "int128"
+ g_type_map.Append(ConstString("__int128_t").GetCString(), eBasicTypeInt128);
+ g_type_map.Append(ConstString("__uint128_t").GetCString(), eBasicTypeUnsignedInt128);
+
+ // Miscelaneous
+ g_type_map.Append(ConstString("bool").GetCString(), eBasicTypeBool);
+ g_type_map.Append(ConstString("float").GetCString(), eBasicTypeFloat);
+ g_type_map.Append(ConstString("double").GetCString(), eBasicTypeDouble);
+ g_type_map.Append(ConstString("long double").GetCString(), eBasicTypeLongDouble);
+ g_type_map.Append(ConstString("id").GetCString(), eBasicTypeObjCID);
+ g_type_map.Append(ConstString("SEL").GetCString(), eBasicTypeObjCSel);
+ g_type_map.Append(ConstString("nullptr").GetCString(), eBasicTypeNullPtr);
+ g_type_map.Sort();
+ });
+
+ return g_type_map.Find(name.GetCString(), eBasicTypeInvalid);
+ }
+ return eBasicTypeInvalid;
+}
+
+ClangASTType
+ClangASTType::GetBasicType (clang::ASTContext *ast, const ConstString &name)
+{
+ if (ast)
+ {
+ lldb::BasicType basic_type = ClangASTType::GetBasicTypeEnumeration (name);
+ return ClangASTType::GetBasicType (ast, basic_type);
+ }
+ return ClangASTType();
+}
+
+ClangASTType
+ClangASTType::GetBasicType (clang::ASTContext *ast, lldb::BasicType type)
+{
+ if (ast)
+ {
+ clang_type_t clang_type = NULL;
+
+ switch (type)
+ {
+ case eBasicTypeInvalid:
+ case eBasicTypeOther:
+ break;
+ case eBasicTypeVoid:
+ clang_type = ast->VoidTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeChar:
+ clang_type = ast->CharTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeSignedChar:
+ clang_type = ast->SignedCharTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedChar:
+ clang_type = ast->UnsignedCharTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeWChar:
+ clang_type = ast->getWCharType().getAsOpaquePtr();
+ break;
+ case eBasicTypeSignedWChar:
+ clang_type = ast->getSignedWCharType().getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedWChar:
+ clang_type = ast->getUnsignedWCharType().getAsOpaquePtr();
+ break;
+ case eBasicTypeChar16:
+ clang_type = ast->Char16Ty.getAsOpaquePtr();
+ break;
+ case eBasicTypeChar32:
+ clang_type = ast->Char32Ty.getAsOpaquePtr();
+ break;
+ case eBasicTypeShort:
+ clang_type = ast->ShortTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedShort:
+ clang_type = ast->UnsignedShortTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeInt:
+ clang_type = ast->IntTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedInt:
+ clang_type = ast->UnsignedIntTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeLong:
+ clang_type = ast->LongTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedLong:
+ clang_type = ast->UnsignedLongTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeLongLong:
+ clang_type = ast->LongLongTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedLongLong:
+ clang_type = ast->UnsignedLongLongTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeInt128:
+ clang_type = ast->Int128Ty.getAsOpaquePtr();
+ break;
+ case eBasicTypeUnsignedInt128:
+ clang_type = ast->UnsignedInt128Ty.getAsOpaquePtr();
+ break;
+ case eBasicTypeBool:
+ clang_type = ast->BoolTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeHalf:
+ clang_type = ast->HalfTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeFloat:
+ clang_type = ast->FloatTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeDouble:
+ clang_type = ast->DoubleTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeLongDouble:
+ clang_type = ast->LongDoubleTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeFloatComplex:
+ clang_type = ast->FloatComplexTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeDoubleComplex:
+ clang_type = ast->DoubleComplexTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeLongDoubleComplex:
+ clang_type = ast->LongDoubleComplexTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeObjCID:
+ clang_type = ast->ObjCBuiltinIdTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeObjCClass:
+ clang_type = ast->ObjCBuiltinClassTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeObjCSel:
+ clang_type = ast->ObjCBuiltinSelTy.getAsOpaquePtr();
+ break;
+ case eBasicTypeNullPtr:
+ clang_type = ast->NullPtrTy.getAsOpaquePtr();
+ break;
+ }
+
+ if (clang_type)
+ return ClangASTType (ast, clang_type);
+ }
+ return ClangASTType();
+}
+
OpenPOWER on IntegriCloud