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"
15
16namespace lldb_private {
17
19public:
22 m_has_object_ptr(false), m_is_self(false), m_is_dynamic_cxx(true),
24
25 bool GetIsDynamicCXXType() const { return m_is_dynamic_cxx; }
26
28
29 void SetUserID(lldb::user_id_t user_id) {
30 m_user_id = user_id;
31 m_union_is_user_id = true;
32 m_union_is_isa_ptr = false;
33 }
34
37 return m_user_id;
38 else
39 return LLDB_INVALID_UID;
40 }
41
42 void SetISAPtr(uint64_t isa_ptr) {
43 m_isa_ptr = isa_ptr;
44 m_union_is_user_id = false;
45 m_union_is_isa_ptr = true;
46 }
47
48 uint64_t GetISAPtr() const {
50 return m_isa_ptr;
51 else
52 return 0;
53 }
54
55 void SetObjectPtrName(const char *name) {
56 m_has_object_ptr = true;
57 if (strcmp(name, "self") == 0)
58 m_is_self = true;
59 else if (strcmp(name, "this") == 0)
60 m_is_self = false;
61 else
62 m_has_object_ptr = false;
63 }
64
66 if (m_has_object_ptr) {
67 if (m_is_self)
69 else
71 }
73 }
74
75 const char *GetObjectPtrName() const {
76 if (m_has_object_ptr) {
77 if (m_is_self)
78 return "self";
79 else
80 return "this";
81 } else
82 return nullptr;
83 }
84
85 bool HasObjectPtr() const { return m_has_object_ptr; }
86
87 /// A type is "forcefully completed" if it was declared complete to satisfy an
88 /// AST invariant (e.g. base classes must be complete types), but in fact we
89 /// were not able to find a actual definition for it.
91
92 void SetIsForcefullyCompleted(bool value = true) {
94 }
95
96 void Dump(Stream *s);
97
98private:
99 union {
101 uint64_t m_isa_ptr;
102 };
103
106};
107
108} // namespace lldb_private
109
110#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)
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
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
#define LLDB_INVALID_UID
Definition: lldb-defines.h:88
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