LLDB mainline
ClangASTMetadata.h
Go to the documentation of this file.
1//===-- ClangASTMetadata.h --------------------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGASTMETADATA_H
10#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGASTMETADATA_H
11
12#include "lldb/Core/dwarf.h"
13#include "lldb/lldb-defines.h"
16
17namespace lldb_private {
18
20public:
23 m_has_object_ptr(false), m_is_self(false),
25 SetIsDynamicCXXType(std::nullopt);
26 }
27
28 std::optional<bool> GetIsDynamicCXXType() const;
29
30 void SetIsDynamicCXXType(std::optional<bool> b);
31
32 void SetUserID(lldb::user_id_t user_id) {
33 m_user_id = user_id;
34 m_union_is_user_id = true;
35 m_union_is_isa_ptr = false;
36 }
37
40 return m_user_id;
41 else
42 return LLDB_INVALID_UID;
43 }
44
45 void SetISAPtr(uint64_t isa_ptr) {
46 m_isa_ptr = isa_ptr;
47 m_union_is_user_id = false;
48 m_union_is_isa_ptr = true;
49 }
50
51 uint64_t GetISAPtr() const {
53 return m_isa_ptr;
54 else
55 return 0;
56 }
57
58 void SetObjectPtrName(const char *name) {
59 m_has_object_ptr = true;
60 if (strcmp(name, "self") == 0)
61 m_is_self = true;
62 else if (strcmp(name, "this") == 0)
63 m_is_self = false;
64 else
65 m_has_object_ptr = false;
66 }
67
77
78 const char *GetObjectPtrName() const {
79 if (m_has_object_ptr) {
80 if (m_is_self)
81 return "self";
82 else
83 return "this";
84 } else
85 return nullptr;
86 }
87
88 bool HasObjectPtr() const { return m_has_object_ptr; }
89
90 /// A type is "forcefully completed" if it was declared complete to satisfy an
91 /// AST invariant (e.g. base classes must be complete types), but in fact we
92 /// were not able to find a actual definition for it.
94
95 void SetIsForcefullyCompleted(bool value = true) {
97 }
98
99 void Dump(Stream *s);
100
101private:
102 union {
104 uint64_t m_isa_ptr;
105 };
106
109};
110
111} // namespace lldb_private
112
113#endif // LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGASTMETADATA_H
void SetUserID(lldb::user_id_t user_id)
void SetObjectPtrName(const char *name)
void SetISAPtr(uint64_t isa_ptr)
void SetIsForcefullyCompleted(bool value=true)
std::optional< bool > GetIsDynamicCXXType() const
bool IsForcefullyCompleted() const
A type is "forcefully completed" if it was declared complete to satisfy an AST invariant (e....
lldb::LanguageType GetObjectPtrLanguage() const
const char * GetObjectPtrName() const
lldb::user_id_t GetUserID() const
void SetIsDynamicCXXType(std::optional< bool > b)
A stream class that can stream formatted output to a file.
Definition Stream.h:28
#define LLDB_INVALID_UID
A class that represents a running process on the host machine.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeObjC
Objective-C.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
uint64_t user_id_t
Definition lldb-types.h:82