Skip to content

Commit 31c8ce6

Browse files
committed
[lldb] Revert more remainders of the redecl-completion rework
1 parent e10cce2 commit 31c8ce6

File tree

13 files changed

+13
-235
lines changed

13 files changed

+13
-235
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_ASTUTILS_H
1010
#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_ASTUTILS_H
1111

12-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
1312
#include "clang/Basic/ASTSourceDescriptor.h"
1413
#include "clang/Sema/Lookup.h"
1514
#include "clang/Sema/MultiplexExternalSemaSource.h"
@@ -30,7 +29,7 @@ namespace lldb_private {
3029
/// Wraps an ExternalASTSource into an ExternalSemaSource.
3130
///
3231
/// Assumes shared ownership of the underlying source.
33-
class ExternalASTSourceWrapper : public ImporterBackedASTSource {
32+
class ExternalASTSourceWrapper : public clang::ExternalSemaSource {
3433
llvm::IntrusiveRefCntPtr<ExternalASTSource> m_Source;
3534

3635
public:
@@ -281,7 +280,7 @@ class ASTConsumerForwarder : public clang::SemaConsumer {
281280
/// provide more accurate replies to the requests, but might not be able to
282281
/// answer all requests. The debug information will be used as a fallback then
283282
/// to provide information that is not in the C++ module.
284-
class SemaSourceWithPriorities : public ImporterBackedASTSource {
283+
class SemaSourceWithPriorities : public clang::ExternalSemaSource {
285284

286285
private:
287286
/// The sources ordered in decreasing priority.

lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
109
#include "lldb/Core/Module.h"
1110
#include "lldb/Utility/LLDBAssert.h"
1211
#include "lldb/Utility/LLDBLog.h"

lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
1515
#include "Plugins/ExpressionParser/Clang/NameSearchContext.h"
16-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
1716
#include "lldb/Symbol/CompilerType.h"
1817
#include "lldb/Target/Target.h"
1918
#include "clang/AST/ExternalASTSource.h"
@@ -31,7 +30,7 @@ namespace lldb_private {
3130
/// knows the name it is looking for, but nothing else. The ExternalSemaSource
3231
/// class provides Decls (VarDecl, FunDecl, TypeDecl) to Clang for these
3332
/// names, consulting the ClangExpressionDeclMap to do the actual lookups.
34-
class ClangASTSource : public ImporterBackedASTSource,
33+
class ClangASTSource : public clang::ExternalASTSource,
3534
public ClangASTImporter::MapCompleter {
3635
public:
3736
/// Constructor
@@ -210,7 +209,7 @@ class ClangASTSource : public ImporterBackedASTSource,
210209
///
211210
/// Clang AST contexts like to own their AST sources, so this is a state-
212211
/// free proxy object.
213-
class ClangASTSourceProxy : public ImporterBackedASTSource {
212+
class ClangASTSourceProxy : public clang::ExternalASTSource {
214213
public:
215214
ClangASTSourceProxy(ClangASTSource &original) : m_original(original) {}
216215

lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXTERNALASTSOURCECALLBACKS_H
1010
#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXTERNALASTSOURCECALLBACKS_H
1111

12-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
1312
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1413
#include "clang/Basic/ASTSourceDescriptor.h"
1514
#include <optional>
@@ -22,15 +21,13 @@ class Module;
2221

2322
namespace lldb_private {
2423

25-
class ClangExternalASTSourceCallbacks : public ImporterBackedASTSource {
24+
class ClangExternalASTSourceCallbacks : public clang::ExternalASTSource {
2625
/// LLVM RTTI support.
2726
static char ID;
2827

2928
public:
3029
/// LLVM RTTI support.
31-
bool isA(const void *ClassID) const override {
32-
return ClassID == &ID || ImporterBackedASTSource::isA(ClassID);
33-
}
30+
bool isA(const void *ClassID) const override { return ClassID == &ID; }
3431
static bool classof(const clang::ExternalASTSource *s) { return s->isA(&ID); }
3532

3633
ClangExternalASTSourceCallbacks(TypeSystemClang &ast) : m_ast(ast) {}

lldb/source/Plugins/ExpressionParser/Clang/ClangUtil.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ clang::TagDecl *ClangUtil::GetAsTagDecl(const CompilerType &type) {
6666
return qual_type->getAsTagDecl();
6767
}
6868

69-
clang::Decl *ClangUtil::GetFirstDecl(clang::Decl *d) {
70-
if (!d)
71-
return nullptr;
72-
if (auto *td = llvm::dyn_cast<clang::TagDecl>(d))
73-
return td->getFirstDecl();
74-
if (auto *od = llvm::dyn_cast<clang::ObjCInterfaceDecl>(d))
75-
return od->getFirstDecl();
76-
return d;
77-
}
78-
7969
clang::ObjCInterfaceDecl *ClangUtil::GetAsObjCDecl(const CompilerType &type) {
8070
clang::QualType qual_type = ClangUtil::GetCanonicalQualType(type);
8171
if (qual_type.isNull())

lldb/source/Plugins/ExpressionParser/Clang/ClangUtil.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ struct ClangUtil {
3636

3737
static clang::TagDecl *GetAsTagDecl(const CompilerType &type);
3838

39-
/// If the given Decl is redeclarable, return the first declaration in its
40-
/// redeclaration chain. Otherwise return d itself.
41-
static clang::Decl *GetFirstDecl(clang::Decl *d);
42-
43-
/// \see ClangUtil::GetFirstDecl
44-
static const clang::Decl *GetFirstDecl(const clang::Decl *d) {
45-
return GetFirstDecl(const_cast<clang::Decl *>(d));
46-
}
47-
4839
static clang::ObjCInterfaceDecl *GetAsObjCDecl(const CompilerType &type);
4940

5041
/// Returns a textual representation of the given Decl's AST. Does not

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
1212
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
1313
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
14-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
1514
#include "lldb/Core/Module.h"
1615
#include "lldb/Target/Process.h"
1716
#include "lldb/Target/Target.h"
@@ -25,7 +24,7 @@
2524
using namespace lldb_private;
2625

2726
class lldb_private::AppleObjCExternalASTSource
28-
: public ImporterBackedASTSource {
27+
: public clang::ExternalASTSource {
2928
public:
3029
AppleObjCExternalASTSource(AppleObjCDeclVendor &decl_vendor)
3130
: m_decl_vendor(decl_vendor) {}

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "DWARFDebugInfo.h"
1414
#include "DWARFDeclContext.h"
1515
#include "DWARFDefines.h"
16-
#include "Plugins/TypeSystem/Clang/ImporterBackedASTSource.h"
1716
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1817
#include "SymbolFileDWARF.h"
1918
#include "SymbolFileDWARFDebugMap.h"
@@ -2033,9 +2032,6 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
20332032
m_ast.SetMetadata(class_template_decl, metadata);
20342033
m_ast.SetMetadata(class_specialization_decl, metadata);
20352034
RegisterDIE(die.GetDIE(), clang_type);
2036-
if (auto *source = llvm::dyn_cast_or_null<ImporterBackedASTSource>(
2037-
m_ast.getASTContext().getExternalSource()))
2038-
source->MarkRedeclChainsAsOutOfDate(m_ast.getASTContext());
20392035
}
20402036

20412037
if (!clang_type) {

lldb/source/Plugins/TypeSystem/Clang/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
add_lldb_library(lldbPluginTypeSystemClang PLUGIN
2-
ImporterBackedASTSource.cpp
32
TypeSystemClang.cpp
43

54
LINK_COMPONENTS

lldb/source/Plugins/TypeSystem/Clang/ImporterBackedASTSource.cpp

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)