1- // ===-- ClangASTContext .h ---------------------------------------*- C++ -*-===//
1+ // ===-- TypeSystemClang .h ---------------------------------------*- C++ -*-===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88
9- #ifndef liblldb_ClangASTContext_h_
10- #define liblldb_ClangASTContext_h_
9+ #ifndef liblldb_TypeSystemClang_h_
10+ #define liblldb_TypeSystemClang_h_
1111
1212#include < stdint.h>
1313
@@ -42,7 +42,7 @@ namespace lldb_private {
4242
4343class Declaration ;
4444
45- class ClangASTContext : public TypeSystem {
45+ class TypeSystemClang : public TypeSystem {
4646 // LLVM RTTI support
4747 static char ID;
4848
@@ -55,24 +55,24 @@ class ClangASTContext : public TypeSystem {
5555 bool isA (const void *ClassID) const override { return ClassID == &ID; }
5656 static bool classof (const TypeSystem *ts) { return ts->isA (&ID); }
5757
58- // / Constructs a ClangASTContext with an ASTContext using the given triple.
58+ // / Constructs a TypeSystemClang with an ASTContext using the given triple.
5959 // /
60- // / \param name The name for the ClangASTContext (for logging purposes)
60+ // / \param name The name for the TypeSystemClang (for logging purposes)
6161 // / \param triple The llvm::Triple used for the ASTContext. The triple defines
6262 // / certain characteristics of the ASTContext and its types
6363 // / (e.g., whether certain primitive types exist or what their
6464 // / signedness is).
65- explicit ClangASTContext (llvm::StringRef name, llvm::Triple triple);
65+ explicit TypeSystemClang (llvm::StringRef name, llvm::Triple triple);
6666
67- // / Constructs a ClangASTContext that uses an existing ASTContext internally.
67+ // / Constructs a TypeSystemClang that uses an existing ASTContext internally.
6868 // / Useful when having an existing ASTContext created by Clang.
6969 // /
70- // / \param name The name for the ClangASTContext (for logging purposes)
70+ // / \param name The name for the TypeSystemClang (for logging purposes)
7171 // / \param existing_ctxt An existing ASTContext.
72- explicit ClangASTContext (llvm::StringRef name,
72+ explicit TypeSystemClang (llvm::StringRef name,
7373 clang::ASTContext &existing_ctxt);
7474
75- ~ClangASTContext () override ;
75+ ~TypeSystemClang () override ;
7676
7777 void Finalize () override ;
7878
@@ -93,21 +93,21 @@ class ClangASTContext : public TypeSystem {
9393
9494 static void Terminate ();
9595
96- static ClangASTContext *GetASTContext (clang::ASTContext *ast_ctx);
96+ static TypeSystemClang *GetASTContext (clang::ASTContext *ast_ctx);
9797
98- static ClangASTContext *GetScratch (Target &target,
98+ static TypeSystemClang *GetScratch (Target &target,
9999 bool create_on_demand = true ) {
100100 auto type_system_or_err = target.GetScratchTypeSystemForLanguage (
101101 lldb::eLanguageTypeC, create_on_demand);
102102 if (auto err = type_system_or_err.takeError ()) {
103103 LLDB_LOG_ERROR (lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_TARGET),
104- std::move (err), " Couldn't get scratch ClangASTContext " );
104+ std::move (err), " Couldn't get scratch TypeSystemClang " );
105105 return nullptr ;
106106 }
107- return llvm::dyn_cast<ClangASTContext >(&type_system_or_err.get ());
107+ return llvm::dyn_cast<TypeSystemClang >(&type_system_or_err.get ());
108108 }
109109
110- // / Returns the display name of this ClangASTContext that indicates what
110+ // / Returns the display name of this TypeSystemClang that indicates what
111111 // / purpose it serves in LLDB. Used for example in logs.
112112 llvm::StringRef getDisplayName () const { return m_display_name; }
113113
@@ -128,7 +128,7 @@ class ClangASTContext : public TypeSystem {
128128 llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_up);
129129
130130 bool GetCompleteDecl (clang::Decl *decl) {
131- return ClangASTContext ::GetCompleteDecl (&getASTContext (), decl);
131+ return TypeSystemClang ::GetCompleteDecl (&getASTContext (), decl);
132132 }
133133
134134 static void DumpDeclHiearchy (clang::Decl *decl);
@@ -176,16 +176,16 @@ class ClangASTContext : public TypeSystem {
176176 bool ignore_qualifiers = false );
177177
178178 // / Creates a CompilerType form the given QualType with the current
179- // / ClangASTContext instance as the CompilerType's typesystem.
179+ // / TypeSystemClang instance as the CompilerType's typesystem.
180180 // / \param qt The QualType for a type that belongs to the ASTContext of this
181- // / ClangASTContext .
181+ // / TypeSystemClang .
182182 // / \return The CompilerType representing the given QualType. If the
183183 // / QualType's type pointer is a nullptr then the function returns an
184184 // / invalid CompilerType.
185185 CompilerType GetType (clang::QualType qt) {
186186 if (qt.getTypePtrOrNull () == nullptr )
187187 return CompilerType ();
188- // Check that the type actually belongs to this ClangASTContext .
188+ // Check that the type actually belongs to this TypeSystemClang .
189189 assert (qt->getAsTagDecl () == nullptr ||
190190 &qt->getAsTagDecl ()->getASTContext () == &getASTContext ());
191191 return CompilerType (this , qt.getAsOpaquePtr ());
@@ -326,7 +326,7 @@ class ClangASTContext : public TypeSystem {
326326 int *assigned_accessibilities,
327327 size_t num_assigned_accessibilities);
328328
329- // Returns a mask containing bits from the ClangASTContext ::eTypeXXX
329+ // Returns a mask containing bits from the TypeSystemClang ::eTypeXXX
330330 // enumerations
331331
332332 // Namespace Declarations
@@ -392,7 +392,7 @@ class ClangASTContext : public TypeSystem {
392392 DWARFASTParser *GetDWARFParser () override ;
393393 PDBASTParser *GetPDBParser () override ;
394394
395- // ClangASTContext callbacks for external source lookups.
395+ // TypeSystemClang callbacks for external source lookups.
396396 void CompleteTagDecl (clang::TagDecl *);
397397
398398 void CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *);
@@ -424,9 +424,9 @@ class ClangASTContext : public TypeSystem {
424424 // CompilerDeclContext override functions
425425
426426 // / Creates a CompilerDeclContext from the given DeclContext
427- // / with the current ClangASTContext instance as its typesystem.
427+ // / with the current TypeSystemClang instance as its typesystem.
428428 // / The DeclContext has to come from the ASTContext of this
429- // / ClangASTContext .
429+ // / TypeSystemClang .
430430 CompilerDeclContext CreateDeclContext (clang::DeclContext *ctx);
431431
432432 std::vector<CompilerDecl>
@@ -466,7 +466,7 @@ class ClangASTContext : public TypeSystem {
466466 const clang::Decl *object);
467467
468468 static clang::ASTContext *
469- DeclContextGetClangASTContext (const CompilerDeclContext &dc);
469+ DeclContextGetTypeSystemClang (const CompilerDeclContext &dc);
470470
471471 // Tests
472472
@@ -898,7 +898,7 @@ class ClangASTContext : public TypeSystem {
898898 clang::ClassTemplateDecl *ParseClassTemplateDecl (
899899 clang::DeclContext *decl_ctx, lldb::AccessType access_type,
900900 const char *parent_name, int tag_decl_kind,
901- const ClangASTContext ::TemplateParameterInfos &template_param_infos);
901+ const TypeSystemClang ::TemplateParameterInfos &template_param_infos);
902902
903903 clang::BlockDecl *CreateBlockDeclaration (clang::DeclContext *ctx);
904904
@@ -936,7 +936,7 @@ class ClangASTContext : public TypeSystem {
936936 const clang::ClassTemplateSpecializationDecl *
937937 GetAsTemplateSpecialization (lldb::opaque_compiler_type_t type);
938938
939- // Classes that inherit from ClangASTContext can see and modify these
939+ // Classes that inherit from TypeSystemClang can see and modify these
940940 std::string m_target_triple;
941941 std::unique_ptr<clang::ASTContext> m_ast_up;
942942 std::unique_ptr<clang::LangOptions> m_language_options_up;
@@ -954,7 +954,7 @@ class ClangASTContext : public TypeSystem {
954954 std::unique_ptr<clang::MangleContext> m_mangle_ctx_up;
955955 uint32_t m_pointer_byte_size = 0 ;
956956 bool m_ast_owned = false ;
957- // / A string describing what this ClangASTContext represents (e.g.,
957+ // / A string describing what this TypeSystemClang represents (e.g.,
958958 // / AST for debug information, an expression, some other utility ClangAST).
959959 // / Useful for logging and debugging.
960960 std::string m_display_name;
@@ -972,19 +972,19 @@ class ClangASTContext : public TypeSystem {
972972 // / ASTContext wasn't created by parsing source code.
973973 clang::Sema *m_sema = nullptr ;
974974
975- // For ClangASTContext only
976- ClangASTContext (const ClangASTContext &);
977- const ClangASTContext &operator =(const ClangASTContext &);
975+ // For TypeSystemClang only
976+ TypeSystemClang (const TypeSystemClang &);
977+ const TypeSystemClang &operator =(const TypeSystemClang &);
978978 // / Creates the internal ASTContext.
979979 void CreateASTContext ();
980980 void SetTargetTriple (llvm::StringRef target_triple);
981981};
982982
983- class ClangASTContextForExpressions : public ClangASTContext {
983+ class TypeSystemClangForExpressions : public TypeSystemClang {
984984public:
985- ClangASTContextForExpressions (Target &target, llvm::Triple triple);
985+ TypeSystemClangForExpressions (Target &target, llvm::Triple triple);
986986
987- ~ClangASTContextForExpressions () override = default ;
987+ ~TypeSystemClangForExpressions () override = default ;
988988
989989 void Finalize () override ;
990990
@@ -1014,4 +1014,4 @@ class ClangASTContextForExpressions : public ClangASTContext {
10141014
10151015} // namespace lldb_private
10161016
1017- #endif // liblldb_ClangASTContext_h_
1017+ #endif // liblldb_TypeSystemClang_h_
0 commit comments