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_utility {
22 namespace lldb_private {
24 class AppleObjCTypeEncodingParser : public ObjCLanguageRuntime::EncodingToType {
26 AppleObjCTypeEncodingParser(ObjCLanguageRuntime &runtime);
27 ~AppleObjCTypeEncodingParser() override = default;
29 CompilerType RealizeType(clang::ASTContext &ast_ctx, const char *name,
30 bool for_expression) override;
33 struct StructElement {
39 ~StructElement() = default;
42 clang::QualType BuildType(clang::ASTContext &ast_ctx,
43 lldb_utility::StringLexer &type,
45 uint32_t *bitfield_bit_size = nullptr);
47 clang::QualType BuildStruct(clang::ASTContext &ast_ctx,
48 lldb_utility::StringLexer &type,
51 clang::QualType BuildAggregate(clang::ASTContext &ast_ctx,
52 lldb_utility::StringLexer &type,
53 bool for_expression, char opener, char closer,
56 clang::QualType BuildUnion(clang::ASTContext &ast_ctx,
57 lldb_utility::StringLexer &type,
60 clang::QualType BuildArray(clang::ASTContext &ast_ctx,
61 lldb_utility::StringLexer &type,
64 std::string ReadStructName(lldb_utility::StringLexer &type);
66 StructElement ReadStructElement(clang::ASTContext &ast_ctx,
67 lldb_utility::StringLexer &type,
70 clang::QualType BuildObjCObjectPointerType(clang::ASTContext &ast_ctx,
71 lldb_utility::StringLexer &type,
74 uint32_t ReadNumber(lldb_utility::StringLexer &type);
76 std::string ReadQuotedString(lldb_utility::StringLexer &type);
78 ObjCLanguageRuntime &m_runtime;
81 } // namespace lldb_private
83 #endif // liblldb_AppleObjCTypeEncodingParser_h_