1 //===-- AppleObjCTypeEncodingParser.h ---------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_AppleObjCTypeEncodingParser_h_
10 #define liblldb_AppleObjCTypeEncodingParser_h_
12 #include "clang/AST/ASTContext.h"
14 #include "lldb/lldb-private.h"
16 #include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
18 namespace lldb_private {
20 class AppleObjCTypeEncodingParser : public ObjCLanguageRuntime::EncodingToType {
22 AppleObjCTypeEncodingParser(ObjCLanguageRuntime &runtime);
23 ~AppleObjCTypeEncodingParser() override = default;
25 CompilerType RealizeType(ClangASTContext &ast_ctx, const char *name,
26 bool for_expression) override;
29 struct StructElement {
35 ~StructElement() = default;
38 clang::QualType BuildType(ClangASTContext &clang_ast_ctx, StringLexer &type,
40 uint32_t *bitfield_bit_size = nullptr);
42 clang::QualType BuildStruct(ClangASTContext &ast_ctx, StringLexer &type,
45 clang::QualType BuildAggregate(ClangASTContext &clang_ast_ctx,
46 StringLexer &type, bool for_expression,
47 char opener, char closer, uint32_t kind);
49 clang::QualType BuildUnion(ClangASTContext &ast_ctx, StringLexer &type,
52 clang::QualType BuildArray(ClangASTContext &ast_ctx, StringLexer &type,
55 std::string ReadStructName(StringLexer &type);
57 StructElement ReadStructElement(ClangASTContext &ast_ctx, StringLexer &type,
60 clang::QualType BuildObjCObjectPointerType(ClangASTContext &clang_ast_ctx,
64 uint32_t ReadNumber(StringLexer &type);
66 std::string ReadQuotedString(StringLexer &type);
68 ObjCLanguageRuntime &m_runtime;
71 } // namespace lldb_private
73 #endif // liblldb_AppleObjCTypeEncodingParser_h_