Skip to content

Commit f94ec57

Browse files
authored
Merge pull request #656 from Teemperor/BackportTypeSystemClangRenameTo20200108
[lldb][NFC] Rename ClangASTContext to TypeSystemClang
2 parents 25ad65c + 1eb0241 commit f94ec57

File tree

93 files changed

+820
-820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+820
-820
lines changed

lldb/include/lldb/Symbol/ClangASTImporter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class ClangASTImporter {
4848
: m_file_manager(clang::FileSystemOptions(),
4949
FileSystem::Instance().GetVirtualFileSystem()) {}
5050

51-
CompilerType CopyType(ClangASTContext &dst, const CompilerType &src_type);
51+
CompilerType CopyType(TypeSystemClang &dst, const CompilerType &src_type);
5252

5353
clang::Decl *CopyDecl(clang::ASTContext *dst_ctx, clang::Decl *decl);
5454

55-
CompilerType DeportType(ClangASTContext &dst, const CompilerType &src_type);
55+
CompilerType DeportType(TypeSystemClang &dst, const CompilerType &src_type);
5656

5757
clang::Decl *DeportDecl(clang::ASTContext *dst_ctx, clang::Decl *decl);
5858

lldb/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
#ifndef liblldb_ClangExternalASTSourceCallbacks_h_
1010
#define liblldb_ClangExternalASTSourceCallbacks_h_
1111

12-
#include "lldb/Symbol/ClangASTContext.h"
12+
#include "lldb/Symbol/TypeSystemClang.h"
1313
#include "clang/AST/ExternalASTSource.h"
1414

1515
namespace lldb_private {
1616

17-
class ClangASTContext;
17+
class TypeSystemClang;
1818

1919
class ClangExternalASTSourceCallbacks : public clang::ExternalASTSource {
2020
public:
21-
ClangExternalASTSourceCallbacks(ClangASTContext &ast) : m_ast(ast) {}
21+
ClangExternalASTSourceCallbacks(TypeSystemClang &ast) : m_ast(ast) {}
2222

2323
void FindExternalLexicalDecls(
2424
const clang::DeclContext *DC,
@@ -38,7 +38,7 @@ class ClangExternalASTSourceCallbacks : public clang::ExternalASTSource {
3838
&VirtualBaseOffsets) override;
3939

4040
private:
41-
ClangASTContext &m_ast;
41+
TypeSystemClang &m_ast;
4242
};
4343

4444
} // namespace lldb_private

lldb/include/lldb/Symbol/CompilerDeclContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CompilerDeclContext {
3838
/// This constructor should only be called from the respective TypeSystem
3939
/// implementation.
4040
///
41-
/// \see lldb_private::ClangASTContext::CreateDeclContext(clang::DeclContext*)
41+
/// \see lldb_private::TypeSystemClang::CreateDeclContext(clang::DeclContext*)
4242
CompilerDeclContext(TypeSystem *type_system, void *decl_ctx)
4343
: m_type_system(type_system), m_opaque_decl_ctx(decl_ctx) {}
4444

lldb/include/lldb/Symbol/CompilerType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CompilerType {
3737
/// This constructor should only be called from the respective TypeSystem
3838
/// implementation.
3939
///
40-
/// \see lldb_private::ClangASTContext::GetType(clang::QualType)
40+
/// \see lldb_private::TypeSystemClang::GetType(clang::QualType)
4141
CompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type)
4242
: m_type(type), m_type_system(type_system) {}
4343

lldb/include/lldb/Symbol/TypeSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class TypeSystem : public PluginInterface {
380380
lldb::offset_t data_offset,
381381
size_t data_byte_size) = 0;
382382

383-
// TODO: Determine if these methods should move to ClangASTContext.
383+
// TODO: Determine if these methods should move to TypeSystemClang.
384384

385385
virtual bool IsPointerOrReferenceType(lldb::opaque_compiler_type_t type,
386386
CompilerType *pointee_type) = 0;

lldb/include/lldb/Symbol/ClangASTContext.h renamed to lldb/include/lldb/Symbol/TypeSystemClang.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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

4343
class Declaration;
4444

45-
class ClangASTContext : public TypeSystem {
45+
class TypeSystemClang : public TypeSystem {
4646
// LLVM RTTI support
4747
static char ID;
4848

@@ -55,21 +55,21 @@ 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
///
6060
/// \param triple The llvm::Triple used for the ASTContext. The triple defines
6161
/// certain characteristics of the ASTContext and its types
6262
/// (e.g., whether certain primitive types exist or what their
6363
/// signedness is).
64-
explicit ClangASTContext(llvm::Triple triple = llvm::Triple());
64+
explicit TypeSystemClang(llvm::Triple triple = llvm::Triple());
6565

66-
/// Constructs a ClangASTContext that uses an existing ASTContext internally.
66+
/// Constructs a TypeSystemClang that uses an existing ASTContext internally.
6767
/// Useful when having an existing ASTContext created by Clang.
6868
///
6969
/// \param existing_ctxt An existing ASTContext.
70-
explicit ClangASTContext(clang::ASTContext &existing_ctxt);
70+
explicit TypeSystemClang(clang::ASTContext &existing_ctxt);
7171

72-
~ClangASTContext() override;
72+
~TypeSystemClang() override;
7373

7474
void Finalize() override;
7575

@@ -90,18 +90,18 @@ class ClangASTContext : public TypeSystem {
9090

9191
static void Terminate();
9292

93-
static ClangASTContext *GetASTContext(clang::ASTContext *ast_ctx);
93+
static TypeSystemClang *GetASTContext(clang::ASTContext *ast_ctx);
9494

95-
static ClangASTContext *GetScratch(Target &target,
95+
static TypeSystemClang *GetScratch(Target &target,
9696
bool create_on_demand = true) {
9797
auto type_system_or_err = target.GetScratchTypeSystemForLanguage(
9898
lldb::eLanguageTypeC, create_on_demand);
9999
if (auto err = type_system_or_err.takeError()) {
100100
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");
102102
return nullptr;
103103
}
104-
return llvm::dyn_cast<ClangASTContext>(&type_system_or_err.get());
104+
return llvm::dyn_cast<TypeSystemClang>(&type_system_or_err.get());
105105
}
106106

107107
clang::ASTContext &getASTContext();
@@ -121,7 +121,7 @@ class ClangASTContext : public TypeSystem {
121121
llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_up);
122122

123123
bool GetCompleteDecl(clang::Decl *decl) {
124-
return ClangASTContext::GetCompleteDecl(&getASTContext(), decl);
124+
return TypeSystemClang::GetCompleteDecl(&getASTContext(), decl);
125125
}
126126

127127
static void DumpDeclHiearchy(clang::Decl *decl);
@@ -169,16 +169,16 @@ class ClangASTContext : public TypeSystem {
169169
bool ignore_qualifiers = false);
170170

171171
/// 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.
173173
/// \param qt The QualType for a type that belongs to the ASTContext of this
174-
/// ClangASTContext.
174+
/// TypeSystemClang.
175175
/// \return The CompilerType representing the given QualType. If the
176176
/// QualType's type pointer is a nullptr then the function returns an
177177
/// invalid CompilerType.
178178
CompilerType GetType(clang::QualType qt) {
179179
if (qt.getTypePtrOrNull() == nullptr)
180180
return CompilerType();
181-
// Check that the type actually belongs to this ClangASTContext.
181+
// Check that the type actually belongs to this TypeSystemClang.
182182
assert(qt->getAsTagDecl() == nullptr ||
183183
&qt->getAsTagDecl()->getASTContext() == &getASTContext());
184184
return CompilerType(this, qt.getAsOpaquePtr());
@@ -319,7 +319,7 @@ class ClangASTContext : public TypeSystem {
319319
int *assigned_accessibilities,
320320
size_t num_assigned_accessibilities);
321321

322-
// Returns a mask containing bits from the ClangASTContext::eTypeXXX
322+
// Returns a mask containing bits from the TypeSystemClang::eTypeXXX
323323
// enumerations
324324

325325
// Namespace Declarations
@@ -385,7 +385,7 @@ class ClangASTContext : public TypeSystem {
385385
DWARFASTParser *GetDWARFParser() override;
386386
PDBASTParser *GetPDBParser() override;
387387

388-
// ClangASTContext callbacks for external source lookups.
388+
// TypeSystemClang callbacks for external source lookups.
389389
void CompleteTagDecl(clang::TagDecl *);
390390

391391
void CompleteObjCInterfaceDecl(clang::ObjCInterfaceDecl *);
@@ -417,9 +417,9 @@ class ClangASTContext : public TypeSystem {
417417
// CompilerDeclContext override functions
418418

419419
/// 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.
421421
/// The DeclContext has to come from the ASTContext of this
422-
/// ClangASTContext.
422+
/// TypeSystemClang.
423423
CompilerDeclContext CreateDeclContext(clang::DeclContext *ctx);
424424

425425
std::vector<CompilerDecl>
@@ -459,7 +459,7 @@ class ClangASTContext : public TypeSystem {
459459
const clang::Decl *object);
460460

461461
static clang::ASTContext *
462-
DeclContextGetClangASTContext(const CompilerDeclContext &dc);
462+
DeclContextGetTypeSystemClang(const CompilerDeclContext &dc);
463463

464464
// Tests
465465

@@ -893,7 +893,7 @@ class ClangASTContext : public TypeSystem {
893893
clang::ClassTemplateDecl *ParseClassTemplateDecl(
894894
clang::DeclContext *decl_ctx, lldb::AccessType access_type,
895895
const char *parent_name, int tag_decl_kind,
896-
const ClangASTContext::TemplateParameterInfos &template_param_infos);
896+
const TypeSystemClang::TemplateParameterInfos &template_param_infos);
897897

898898
clang::BlockDecl *CreateBlockDeclaration(clang::DeclContext *ctx);
899899

@@ -931,7 +931,7 @@ class ClangASTContext : public TypeSystem {
931931
const clang::ClassTemplateSpecializationDecl *
932932
GetAsTemplateSpecialization(lldb::opaque_compiler_type_t type);
933933

934-
// Classes that inherit from ClangASTContext can see and modify these
934+
// Classes that inherit from TypeSystemClang can see and modify these
935935
std::string m_target_triple;
936936
std::unique_ptr<clang::ASTContext> m_ast_up;
937937
std::unique_ptr<clang::LangOptions> m_language_options_up;
@@ -963,19 +963,19 @@ class ClangASTContext : public TypeSystem {
963963
/// ASTContext wasn't created by parsing source code.
964964
clang::Sema *m_sema = nullptr;
965965

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 &);
969969
/// Creates the internal ASTContext.
970970
void CreateASTContext();
971971
void SetTargetTriple(llvm::StringRef target_triple);
972972
};
973973

974-
class ClangASTContextForExpressions : public ClangASTContext {
974+
class TypeSystemClangForExpressions : public TypeSystemClang {
975975
public:
976-
ClangASTContextForExpressions(Target &target, llvm::Triple triple);
976+
TypeSystemClangForExpressions(Target &target, llvm::Triple triple);
977977

978-
~ClangASTContextForExpressions() override = default;
978+
~TypeSystemClangForExpressions() override = default;
979979

980980
void Finalize() override;
981981

@@ -1005,4 +1005,4 @@ class ClangASTContextForExpressions : public ClangASTContext {
10051005

10061006
} // namespace lldb_private
10071007

1008-
#endif // liblldb_ClangASTContext_h_
1008+
#endif // liblldb_TypeSystemClang_h_

lldb/include/lldb/lldb-forward.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BroadcastEventSpec;
4545
class Broadcaster;
4646
class BroadcasterManager;
4747
class CallFrameInfo;
48-
class ClangASTContext;
48+
class TypeSystemClang;
4949
class ClangASTImporter;
5050
class ClangASTMetadata;
5151
class ClangASTSource;
@@ -304,7 +304,7 @@ typedef std::shared_ptr<lldb_private::BreakpointResolver> BreakpointResolverSP;
304304
typedef std::shared_ptr<lldb_private::Broadcaster> BroadcasterSP;
305305
typedef std::shared_ptr<lldb_private::BroadcasterManager> BroadcasterManagerSP;
306306
typedef std::weak_ptr<lldb_private::BroadcasterManager> BroadcasterManagerWP;
307-
typedef std::unique_ptr<lldb_private::ClangASTContext> ClangASTContextUP;
307+
typedef std::unique_ptr<lldb_private::TypeSystemClang> TypeSystemClangUP;
308308
typedef std::shared_ptr<lldb_private::ClangASTImporter> ClangASTImporterSP;
309309
typedef std::unique_ptr<lldb_private::ClangModulesDeclVendor>
310310
ClangModulesDeclVendorUP;

lldb/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test(self):
4040
self.expect("fr var all", DATA_TYPES_DISPLAYED_CORRECTLY,
4141
patterns=[' = ALL$'])
4242
# Test that an enum that doesn't match the heuristic we use in
43-
# ClangASTContext::DumpEnumValue, gets printed as a raw integer.
43+
# TypeSystemClang::DumpEnumValue, gets printed as a raw integer.
4444
self.expect("fr var omega", DATA_TYPES_DISPLAYED_CORRECTLY,
4545
patterns=[' = 7$'])
4646
# Test the behavior in case have a variable of a type considered

lldb/source/API/SystemInitializerFull.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "lldb/Host/Host.h"
2323
#include "lldb/Initialization/SystemInitializerCommon.h"
2424
#include "lldb/Interpreter/CommandInterpreter.h"
25-
#include "lldb/Symbol/ClangASTContext.h"
25+
#include "lldb/Symbol/TypeSystemClang.h"
2626
#include "lldb/Utility/Timer.h"
2727

2828
#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"
@@ -214,7 +214,7 @@ llvm::Error SystemInitializerFull::Initialize() {
214214
llvm::InitializeAllTargetMCs();
215215
llvm::InitializeAllDisassemblers();
216216

217-
ClangASTContext::Initialize();
217+
TypeSystemClang::Initialize();
218218

219219
#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Initialize)
220220
#include "llvm/Config/Targets.def"
@@ -312,7 +312,7 @@ void SystemInitializerFull::Terminate() {
312312
// Terminate and unload and loaded system or user LLDB plug-ins
313313
PluginManager::Terminate();
314314

315-
ClangASTContext::Terminate();
315+
TypeSystemClang::Terminate();
316316

317317
ArchitectureArm::Terminate();
318318
ArchitectureMips::Terminate();

lldb/source/Core/ValueObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "lldb/DataFormatters/ValueObjectPrinter.h"
2626
#include "lldb/Expression/ExpressionVariable.h"
2727
#include "lldb/Host/Config.h"
28-
#include "lldb/Symbol/ClangASTContext.h"
28+
#include "lldb/Symbol/TypeSystemClang.h"
2929
#include "lldb/Symbol/CompileUnit.h"
3030
#include "lldb/Symbol/CompilerType.h"
3131
#include "lldb/Symbol/Declaration.h"
@@ -2019,7 +2019,7 @@ bool ValueObject::GetBaseClassPath(Stream &s) {
20192019
GetParent() && GetParent()->GetBaseClassPath(s);
20202020
CompilerType compiler_type = GetCompilerType();
20212021
llvm::Optional<std::string> cxx_class_name =
2022-
ClangASTContext::GetCXXClassName(compiler_type);
2022+
TypeSystemClang::GetCXXClassName(compiler_type);
20232023
if (cxx_class_name) {
20242024
if (parent_had_base_class)
20252025
s.PutCString("::");

0 commit comments

Comments
 (0)