1
- // ===-- ClangASTContext .h ---------------------------------------*- C++ -*-===//
1
+ // ===-- TypeSystemClang .h ---------------------------------------*- C++ -*-===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- #ifndef liblldb_ClangASTContext_h_
10
- #define liblldb_ClangASTContext_h_
9
+ #ifndef liblldb_TypeSystemClang_h_
10
+ #define liblldb_TypeSystemClang_h_
11
11
12
12
#include < stdint.h>
13
13
@@ -42,7 +42,7 @@ namespace lldb_private {
42
42
43
43
class Declaration ;
44
44
45
- class ClangASTContext : public TypeSystem {
45
+ class TypeSystemClang : public TypeSystem {
46
46
// LLVM RTTI support
47
47
static char ID;
48
48
@@ -55,21 +55,21 @@ class ClangASTContext : public TypeSystem {
55
55
bool isA (const void *ClassID) const override { return ClassID == &ID; }
56
56
static bool classof (const TypeSystem *ts) { return ts->isA (&ID); }
57
57
58
- // / Constructs a ClangASTContext with an ASTContext using the given triple.
58
+ // / Constructs a TypeSystemClang with an ASTContext using the given triple.
59
59
// /
60
60
// / \param triple The llvm::Triple used for the ASTContext. The triple defines
61
61
// / certain characteristics of the ASTContext and its types
62
62
// / (e.g., whether certain primitive types exist or what their
63
63
// / signedness is).
64
- explicit ClangASTContext (llvm::Triple triple = llvm::Triple());
64
+ explicit TypeSystemClang (llvm::Triple triple = llvm::Triple());
65
65
66
- // / Constructs a ClangASTContext that uses an existing ASTContext internally.
66
+ // / Constructs a TypeSystemClang that uses an existing ASTContext internally.
67
67
// / Useful when having an existing ASTContext created by Clang.
68
68
// /
69
69
// / \param existing_ctxt An existing ASTContext.
70
- explicit ClangASTContext (clang::ASTContext &existing_ctxt);
70
+ explicit TypeSystemClang (clang::ASTContext &existing_ctxt);
71
71
72
- ~ClangASTContext () override ;
72
+ ~TypeSystemClang () override ;
73
73
74
74
void Finalize () override ;
75
75
@@ -90,18 +90,18 @@ class ClangASTContext : public TypeSystem {
90
90
91
91
static void Terminate ();
92
92
93
- static ClangASTContext *GetASTContext (clang::ASTContext *ast_ctx);
93
+ static TypeSystemClang *GetASTContext (clang::ASTContext *ast_ctx);
94
94
95
- static ClangASTContext *GetScratch (Target &target,
95
+ static TypeSystemClang *GetScratch (Target &target,
96
96
bool create_on_demand = true ) {
97
97
auto type_system_or_err = target.GetScratchTypeSystemForLanguage (
98
98
lldb::eLanguageTypeC, create_on_demand);
99
99
if (auto err = type_system_or_err.takeError ()) {
100
100
LLDB_LOG_ERROR (lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_TARGET),
101
- std::move (err), " Couldn't get scratch ClangASTContext " );
101
+ std::move (err), " Couldn't get scratch TypeSystemClang " );
102
102
return nullptr ;
103
103
}
104
- return llvm::dyn_cast<ClangASTContext >(&type_system_or_err.get ());
104
+ return llvm::dyn_cast<TypeSystemClang >(&type_system_or_err.get ());
105
105
}
106
106
107
107
clang::ASTContext &getASTContext ();
@@ -121,7 +121,7 @@ class ClangASTContext : public TypeSystem {
121
121
llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_up);
122
122
123
123
bool GetCompleteDecl (clang::Decl *decl) {
124
- return ClangASTContext ::GetCompleteDecl (&getASTContext (), decl);
124
+ return TypeSystemClang ::GetCompleteDecl (&getASTContext (), decl);
125
125
}
126
126
127
127
static void DumpDeclHiearchy (clang::Decl *decl);
@@ -169,16 +169,16 @@ class ClangASTContext : public TypeSystem {
169
169
bool ignore_qualifiers = false );
170
170
171
171
// / Creates a CompilerType form the given QualType with the current
172
- // / ClangASTContext instance as the CompilerType's typesystem.
172
+ // / TypeSystemClang instance as the CompilerType's typesystem.
173
173
// / \param qt The QualType for a type that belongs to the ASTContext of this
174
- // / ClangASTContext .
174
+ // / TypeSystemClang .
175
175
// / \return The CompilerType representing the given QualType. If the
176
176
// / QualType's type pointer is a nullptr then the function returns an
177
177
// / invalid CompilerType.
178
178
CompilerType GetType (clang::QualType qt) {
179
179
if (qt.getTypePtrOrNull () == nullptr )
180
180
return CompilerType ();
181
- // Check that the type actually belongs to this ClangASTContext .
181
+ // Check that the type actually belongs to this TypeSystemClang .
182
182
assert (qt->getAsTagDecl () == nullptr ||
183
183
&qt->getAsTagDecl ()->getASTContext () == &getASTContext ());
184
184
return CompilerType (this , qt.getAsOpaquePtr ());
@@ -319,7 +319,7 @@ class ClangASTContext : public TypeSystem {
319
319
int *assigned_accessibilities,
320
320
size_t num_assigned_accessibilities);
321
321
322
- // Returns a mask containing bits from the ClangASTContext ::eTypeXXX
322
+ // Returns a mask containing bits from the TypeSystemClang ::eTypeXXX
323
323
// enumerations
324
324
325
325
// Namespace Declarations
@@ -385,7 +385,7 @@ class ClangASTContext : public TypeSystem {
385
385
DWARFASTParser *GetDWARFParser () override ;
386
386
PDBASTParser *GetPDBParser () override ;
387
387
388
- // ClangASTContext callbacks for external source lookups.
388
+ // TypeSystemClang callbacks for external source lookups.
389
389
void CompleteTagDecl (clang::TagDecl *);
390
390
391
391
void CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *);
@@ -417,9 +417,9 @@ class ClangASTContext : public TypeSystem {
417
417
// CompilerDeclContext override functions
418
418
419
419
// / Creates a CompilerDeclContext from the given DeclContext
420
- // / with the current ClangASTContext instance as its typesystem.
420
+ // / with the current TypeSystemClang instance as its typesystem.
421
421
// / The DeclContext has to come from the ASTContext of this
422
- // / ClangASTContext .
422
+ // / TypeSystemClang .
423
423
CompilerDeclContext CreateDeclContext (clang::DeclContext *ctx);
424
424
425
425
std::vector<CompilerDecl>
@@ -459,7 +459,7 @@ class ClangASTContext : public TypeSystem {
459
459
const clang::Decl *object);
460
460
461
461
static clang::ASTContext *
462
- DeclContextGetClangASTContext (const CompilerDeclContext &dc);
462
+ DeclContextGetTypeSystemClang (const CompilerDeclContext &dc);
463
463
464
464
// Tests
465
465
@@ -893,7 +893,7 @@ class ClangASTContext : public TypeSystem {
893
893
clang::ClassTemplateDecl *ParseClassTemplateDecl (
894
894
clang::DeclContext *decl_ctx, lldb::AccessType access_type,
895
895
const char *parent_name, int tag_decl_kind,
896
- const ClangASTContext ::TemplateParameterInfos &template_param_infos);
896
+ const TypeSystemClang ::TemplateParameterInfos &template_param_infos);
897
897
898
898
clang::BlockDecl *CreateBlockDeclaration (clang::DeclContext *ctx);
899
899
@@ -931,7 +931,7 @@ class ClangASTContext : public TypeSystem {
931
931
const clang::ClassTemplateSpecializationDecl *
932
932
GetAsTemplateSpecialization (lldb::opaque_compiler_type_t type);
933
933
934
- // Classes that inherit from ClangASTContext can see and modify these
934
+ // Classes that inherit from TypeSystemClang can see and modify these
935
935
std::string m_target_triple;
936
936
std::unique_ptr<clang::ASTContext> m_ast_up;
937
937
std::unique_ptr<clang::LangOptions> m_language_options_up;
@@ -963,19 +963,19 @@ class ClangASTContext : public TypeSystem {
963
963
// / ASTContext wasn't created by parsing source code.
964
964
clang::Sema *m_sema = nullptr ;
965
965
966
- // For ClangASTContext only
967
- ClangASTContext (const ClangASTContext &);
968
- const ClangASTContext &operator =(const ClangASTContext &);
966
+ // For TypeSystemClang only
967
+ TypeSystemClang (const TypeSystemClang &);
968
+ const TypeSystemClang &operator =(const TypeSystemClang &);
969
969
// / Creates the internal ASTContext.
970
970
void CreateASTContext ();
971
971
void SetTargetTriple (llvm::StringRef target_triple);
972
972
};
973
973
974
- class ClangASTContextForExpressions : public ClangASTContext {
974
+ class TypeSystemClangForExpressions : public TypeSystemClang {
975
975
public:
976
- ClangASTContextForExpressions (Target &target, llvm::Triple triple);
976
+ TypeSystemClangForExpressions (Target &target, llvm::Triple triple);
977
977
978
- ~ClangASTContextForExpressions () override = default ;
978
+ ~TypeSystemClangForExpressions () override = default ;
979
979
980
980
void Finalize () override ;
981
981
@@ -1005,4 +1005,4 @@ class ClangASTContextForExpressions : public ClangASTContext {
1005
1005
1006
1006
} // namespace lldb_private
1007
1007
1008
- #endif // liblldb_ClangASTContext_h_
1008
+ #endif // liblldb_TypeSystemClang_h_
0 commit comments