This is currently only implemented for the clang-based TypeSystem, but other languages are welcome to jump in!
llvm-svn: 280151
GetArrayElementType ();
lldb::SBType
+ GetArrayType (uint64_t size);
+
+ lldb::SBType
GetVectorElementType ();
lldb::SBType
GetArrayElementType (lldb::opaque_compiler_type_t type, uint64_t *stride) override;
CompilerType
+ GetArrayType (lldb::opaque_compiler_type_t type, uint64_t size) override;
+
+ CompilerType
GetCanonicalType (lldb::opaque_compiler_type_t type) override;
CompilerType
GetArrayElementType(uint64_t *stride = nullptr) const;
CompilerType
+ GetArrayType (uint64_t size) const;
+
+ CompilerType
GetCanonicalType () const;
CompilerType
GetArrayElementType (lldb::opaque_compiler_type_t type, uint64_t *stride) = 0;
virtual CompilerType
+ GetArrayType (lldb::opaque_compiler_type_t type, uint64_t size);
+
+ virtual CompilerType
GetCanonicalType (lldb::opaque_compiler_type_t type) = 0;
// Returns -1 if this isn't a function of if the function doesn't have a prototype
lldb::SBType
GetArrayElementType ();
+
+ lldb::SBType
+ GetArrayType (uint64_t size);
lldb::SBType
GetVectorElementType ();
}
SBType
+SBType::GetArrayType (uint64_t size)
+{
+ if (!IsValid())
+ return SBType();
+ return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size))));
+}
+
+SBType
SBType::GetVectorElementType ()
{
SBType type_sb;
}
CompilerType
+ClangASTContext::GetArrayType (lldb::opaque_compiler_type_t type, uint64_t size)
+{
+ if (type)
+ {
+ clang::QualType qual_type(GetCanonicalQualType(type));
+ if (clang::ASTContext *ast_ctx = getASTContext())
+ {
+ if (size == 0)
+ return CompilerType (ast_ctx, ast_ctx->getConstantArrayType(qual_type, llvm::APInt(64, size), clang::ArrayType::ArraySizeModifier::Normal, 0));
+ else
+ return CompilerType (ast_ctx, ast_ctx->getIncompleteArrayType(qual_type, clang::ArrayType::ArraySizeModifier::Normal, 0));
+ }
+ }
+
+ return CompilerType();
+}
+
+CompilerType
ClangASTContext::GetCanonicalType (lldb::opaque_compiler_type_t type)
{
if (type)
if (IsValid())
{
return m_type_system->GetArrayElementType(m_type, stride);
-
+ }
+ return CompilerType();
+}
+
+CompilerType
+CompilerType::GetArrayType (uint64_t size) const
+{
+ if (IsValid())
+ {
+ return m_type_system->GetArrayType(m_type, size);
}
return CompilerType();
}
}
CompilerType
+TypeSystem::GetArrayType (lldb::opaque_compiler_type_t type, uint64_t size)
+{
+ return CompilerType();
+}
+
+CompilerType
TypeSystem::GetLValueReferenceType (lldb::opaque_compiler_type_t type)
{
return CompilerType();