[Lldb-commits] [lldb] c178fea - [lldb][TypeSystemClang][NFC] Remove redundant parameter to CreateObjCClass
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 7 15:10:28 PDT 2024
Author: Michael Buch
Date: 2024-08-07T23:09:45+01:00
New Revision: c178fea62d3999acd42f3ddfcc8bd436b574cfed
URL: https://github.com/llvm/llvm-project/commit/c178fea62d3999acd42f3ddfcc8bd436b574cfed
DIFF: https://github.com/llvm/llvm-project/commit/c178fea62d3999acd42f3ddfcc8bd436b574cfed.diff
LOG: [lldb][TypeSystemClang][NFC] Remove redundant parameter to CreateObjCClass
This parameter used to be passed down to
`clang::ObjCInterfaceDecl::Create`. But that
parameter was removed in `dc9166c8e1120dc0df1859ba6e3d457a458fd20f`.
In LLDB the `isForwardDecl` stopped being used when it was
synced against Clang in `5b26f27f465676684f9440f02ac4e84a252f5bbb`.
Added:
Modified:
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/unittests/Symbol/TestTypeSystemClang.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 66394665d29c5f..8f646803848096 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1229,10 +1229,8 @@ CompilerType TypeSystemClang::CreateRecordType(
if (language == eLanguageTypeObjC ||
language == eLanguageTypeObjC_plus_plus) {
- bool isForwardDecl = true;
bool isInternal = false;
- return CreateObjCClass(name, decl_ctx, owning_module, isForwardDecl,
- isInternal, metadata);
+ return CreateObjCClass(name, decl_ctx, owning_module, isInternal, metadata);
}
// NOTE: Eventually CXXRecordDecl will be merged back into RecordDecl and
@@ -1799,7 +1797,7 @@ bool TypeSystemClang::RecordHasFields(const RecordDecl *record_decl) {
CompilerType TypeSystemClang::CreateObjCClass(
llvm::StringRef name, clang::DeclContext *decl_ctx,
- OptionalClangModuleID owning_module, bool isForwardDecl, bool isInternal,
+ OptionalClangModuleID owning_module, bool isInternal,
std::optional<ClangASTMetadata> metadata) {
ASTContext &ast = getASTContext();
assert(!name.empty());
@@ -1810,7 +1808,6 @@ CompilerType TypeSystemClang::CreateObjCClass(
ObjCInterfaceDecl::CreateDeserialized(ast, GlobalDeclID());
decl->setDeclContext(decl_ctx);
decl->setDeclName(&ast.Idents.get(name));
- /*isForwardDecl,*/
decl->setImplicit(isInternal);
SetOwningModule(decl, owning_module);
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 789352750b222e..e39aedec7e3902 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -457,8 +457,7 @@ class TypeSystemClang : public TypeSystem {
CompilerType
CreateObjCClass(llvm::StringRef name, clang::DeclContext *decl_ctx,
- OptionalClangModuleID owning_module, bool isForwardDecl,
- bool isInternal,
+ OptionalClangModuleID owning_module, bool isInternal,
std::optional<ClangASTMetadata> metadata = std::nullopt);
// Returns a mask containing bits from the TypeSystemClang::eTypeXXX
diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp
index 2c2dae01e1b07d..7d64e1cdd56f64 100644
--- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp
+++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp
@@ -303,7 +303,7 @@ TEST_F(TestTypeSystemClang, TestOwningModule) {
CompilerType class_type =
ast.CreateObjCClass("objc_class", ast.GetTranslationUnitDecl(),
- OptionalClangModuleID(300), false, false);
+ OptionalClangModuleID(300), false);
auto *cd = TypeSystemClang::GetAsObjCInterfaceDecl(class_type);
EXPECT_FALSE(!cd);
EXPECT_EQ(cd->getOwningModuleID(), 300u);
@@ -925,7 +925,6 @@ TEST_F(TestTypeSystemClang, AddMethodToObjCObjectType) {
// Create an interface decl and mark it as having external storage.
CompilerType c = m_ast->CreateObjCClass("A", m_ast->GetTranslationUnitDecl(),
OptionalClangModuleID(),
- /*IsForwardDecl*/ false,
/*IsInternal*/ false);
ObjCInterfaceDecl *interface = m_ast->GetAsObjCInterfaceDecl(c);
m_ast->SetHasExternalStorage(c.GetOpaqueQualType(), true);
More information about the lldb-commits
mailing list