Skip to content

Commit 4c1b2e9

Browse files
authored
Merge pull request #9977 from swiftlang/lldb/remove-tc-patch
[lldb] Remove redecl-completion setting
2 parents 04d0215 + a0346b7 commit 4c1b2e9

File tree

43 files changed

+78
-645
lines changed

Some content is hidden

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

43 files changed

+78
-645
lines changed

clang/include/clang/AST/ASTImporter.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ class TypeSourceInfo;
211211

212212
/// Whether to perform a minimal import.
213213
bool Minimal;
214-
bool LLDBRedeclCompletion = false;
215214

216215
ODRHandlingType ODRHandling;
217216

@@ -297,10 +296,8 @@ class TypeSourceInfo;
297296
/// Whether the importer will perform a minimal import, creating
298297
/// to-be-completed forward declarations when possible.
299298
bool isMinimalImport() const { return Minimal; }
300-
bool hasLLDBRedeclCompletion() const { return LLDBRedeclCompletion; }
301299

302300
void setODRHandling(ODRHandlingType T) { ODRHandling = T; }
303-
void setLLDBRedeclCompletion(bool Val) { LLDBRedeclCompletion = Val; }
304301

305302
/// \brief Import the given object, returns the result.
306303
///

clang/include/clang/AST/ExternalASTSource.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ class ExternalASTSource : public RefCountedBase<ExternalASTSource> {
152152
virtual bool
153153
FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name);
154154

155-
virtual bool FindExternalVisibleMethodsByName(const DeclContext *DC,
156-
DeclarationName Name) {
157-
return false;
158-
}
159-
160155
/// Ensures that the table of all visible declarations inside this
161156
/// context is up to date.
162157
///

clang/lib/AST/ASTImporter.cpp

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,7 @@ Expected<LambdaCapture> ASTNodeImporter::import(const LambdaCapture &From) {
10261026

10271027
template <typename T>
10281028
bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) {
1029-
if (!Importer.hasLLDBRedeclCompletion() &&
1030-
Found->getLinkageInternal() != From->getLinkageInternal())
1029+
if (Found->getLinkageInternal() != From->getLinkageInternal())
10311030
return false;
10321031

10331032
if (From->hasExternalFormalLinkage())
@@ -1972,8 +1971,7 @@ Error ASTNodeImporter::ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD) {
19721971
if (RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
19731972
if (RecordDecl *ToRecord = cast<RecordDecl>(ToD)) {
19741973
if (FromRecord->getDefinition() && !ToRecord->getDefinition() &&
1975-
(Importer.hasLLDBRedeclCompletion() ||
1976-
FromRecord->isCompleteDefinition())) {
1974+
FromRecord->isCompleteDefinition()) {
19771975
if (Error Err = ImportDefinition(FromRecord, ToRecord))
19781976
return Err;
19791977
}
@@ -2075,14 +2073,12 @@ ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
20752073
continue;
20762074
}
20772075

2078-
if (!Importer.hasLLDBRedeclCompletion()) {
2079-
FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From);
2080-
Decl *ImportedDecl = *ImportedOrErr;
2081-
FieldDecl *FieldTo = dyn_cast_or_null<FieldDecl>(ImportedDecl);
2082-
if (FieldFrom && FieldTo) {
2083-
Error Err = ImportFieldDeclDefinition(FieldFrom, FieldTo);
2084-
HandleChildErrors.handleChildImportResult(ChildErrors, std::move(Err));
2085-
}
2076+
FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From);
2077+
Decl *ImportedDecl = *ImportedOrErr;
2078+
FieldDecl *FieldTo = dyn_cast_or_null<FieldDecl>(ImportedDecl);
2079+
if (FieldFrom && FieldTo) {
2080+
Error Err = ImportFieldDeclDefinition(FieldFrom, FieldTo);
2081+
HandleChildErrors.handleChildImportResult(ChildErrors, std::move(Err));
20862082
}
20872083
}
20882084

@@ -2243,11 +2239,7 @@ Error ASTNodeImporter::ImportDefinition(
22432239
To->completeDefinition();
22442240
};
22452241

2246-
bool hasDef = (Importer.hasLLDBRedeclCompletion() &&
2247-
To->isThisDeclarationADefinition()) ||
2248-
To->getDefinition();
2249-
2250-
if (hasDef || To->isBeingDefined()) {
2242+
if (To->getDefinition() || To->isBeingDefined()) {
22512243
if (Kind == IDK_Everything ||
22522244
// In case of lambdas, the class already has a definition ptr set, but
22532245
// the contained decls are not imported yet. Also, isBeingDefined was
@@ -2769,7 +2761,7 @@ ASTNodeImporter::VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias) {
27692761
continue;
27702762
}
27712763

2772-
if (Importer.hasLLDBRedeclCompletion() && Importer.isMinimalImport())
2764+
if (Importer.isMinimalImport())
27732765
return Importer.MapImported(D, FoundTypedef);
27742766
// If the "From" context has a complete underlying type but we
27752767
// already have a complete underlying type then return with that.
@@ -3042,11 +3034,9 @@ ExpectedDecl ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
30423034
return POIOrErr.takeError();
30433035
}
30443036

3045-
auto Kind = Importer.hasLLDBRedeclCompletion() ? IDK_Everything : IDK_Default;
3046-
30473037
// Import the definition
30483038
if (D->isCompleteDefinition())
3049-
if (Error Err = ImportDefinition(D, D2, Kind))
3039+
if (Error Err = ImportDefinition(D, D2, IDK_Default))
30503040
return std::move(Err);
30513041

30523042
return D2;
@@ -3128,8 +3118,7 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) {
31283118

31293119
if (IsStructuralMatch(D, FoundRecord)) {
31303120
RecordDecl *FoundDef = FoundRecord->getDefinition();
3131-
if (!Importer.hasLLDBRedeclCompletion() &&
3132-
D->isThisDeclarationADefinition() && FoundDef) {
3121+
if (D->isThisDeclarationADefinition() && FoundDef) {
31333122
// FIXME: Structural equivalence check should check for same
31343123
// user-defined methods.
31353124
Importer.MapImported(D, FoundDef);
@@ -3300,9 +3289,8 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) {
33003289
if (D->isAnonymousStructOrUnion())
33013290
D2->setAnonymousStructOrUnion(true);
33023291

3303-
auto Kind = Importer.hasLLDBRedeclCompletion() ? IDK_Everything : IDK_Default;
33043292
if (D->isCompleteDefinition())
3305-
if (Error Err = ImportDefinition(D, D2, Kind))
3293+
if (Error Err = ImportDefinition(D, D2, IDK_Default))
33063294
return std::move(Err);
33073295

33083296
return D2;
@@ -5486,8 +5474,7 @@ Error ASTNodeImporter::ImportDefinition(
54865474
diag::note_odr_objc_missing_superclass);
54875475
}
54885476

5489-
if (Importer.hasLLDBRedeclCompletion() ||
5490-
shouldForceImportDeclContext(Kind))
5477+
if (shouldForceImportDeclContext(Kind))
54915478
if (Error Err = ImportDeclContext(From))
54925479
return Err;
54935480
return Error::success();
@@ -6379,9 +6366,8 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateSpecializationDecl(
63796366
}
63806367
}
63816368

6382-
auto Kind = Importer.hasLLDBRedeclCompletion() ? IDK_Everything : IDK_Default;
63836369
if (D->isCompleteDefinition())
6384-
if (Error Err = ImportDefinition(D, D2, Kind))
6370+
if (Error Err = ImportDefinition(D, D2, IDK_Default))
63856371
return std::move(Err);
63866372

63876373
return D2;

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -735,13 +735,6 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
735735
DeclContext *DC = SS.isSet() ? SemaRef.computeDeclContext(SS)
736736
: SemaRef.computeDeclContext(RTy);
737737

738-
if (ExternalASTSource *Source =
739-
DC->getParentASTContext().getExternalSource()) {
740-
if (auto LookupName = R.getLookupName()) {
741-
Source->FindExternalVisibleMethodsByName(DC, LookupName);
742-
}
743-
}
744-
745738
struct QueryState {
746739
Sema &SemaRef;
747740
DeclarationNameInfo NameInfo;

lldb/include/lldb/Core/PluginManager.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ class PluginManager {
476476
// TypeSystem
477477
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
478478
TypeSystemCreateInstance create_callback,
479-
DebuggerInitializeCallback debugger_callback,
480479
LanguageSet supported_languages_for_types,
481480
LanguageSet supported_languages_for_expressions);
482481

@@ -558,13 +557,6 @@ class PluginManager {
558557
Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
559558
llvm::StringRef description, bool is_global_property);
560559

561-
static lldb::OptionValuePropertiesSP
562-
GetSettingForTypeSystemPlugin(Debugger &debugger, ConstString setting_name);
563-
564-
static bool CreateSettingForTypeSystemPlugin(
565-
Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
566-
ConstString description, bool is_global_property);
567-
568560
static bool CreateSettingForTracePlugin(
569561
Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
570562
llvm::StringRef description, bool is_global_property);

lldb/source/Core/PluginManager.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,11 +1455,10 @@ PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx) {
14551455
struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
14561456
TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
14571457
CallbackType create_callback,
1458-
DebuggerInitializeCallback debugger_init_callback,
14591458
LanguageSet supported_languages_for_types,
14601459
LanguageSet supported_languages_for_expressions)
1461-
: PluginInstance<TypeSystemCreateInstance>(
1462-
name, description, create_callback, debugger_init_callback),
1460+
: PluginInstance<TypeSystemCreateInstance>(name, description,
1461+
create_callback),
14631462
supported_languages_for_types(supported_languages_for_types),
14641463
supported_languages_for_expressions(
14651464
supported_languages_for_expressions) {}
@@ -1478,12 +1477,11 @@ static TypeSystemInstances &GetTypeSystemInstances() {
14781477
bool PluginManager::RegisterPlugin(
14791478
llvm::StringRef name, llvm::StringRef description,
14801479
TypeSystemCreateInstance create_callback,
1481-
DebuggerInitializeCallback debugger_init_callback,
14821480
LanguageSet supported_languages_for_types,
14831481
LanguageSet supported_languages_for_expressions) {
14841482
return GetTypeSystemInstances().RegisterPlugin(
1485-
name, description, create_callback, debugger_init_callback,
1486-
supported_languages_for_types, supported_languages_for_expressions);
1483+
name, description, create_callback, supported_languages_for_types,
1484+
supported_languages_for_expressions);
14871485
}
14881486

14891487
bool PluginManager::UnregisterPlugin(TypeSystemCreateInstance create_callback) {
@@ -1762,7 +1760,6 @@ static constexpr llvm::StringLiteral kTracePluginName("trace");
17621760
static constexpr llvm::StringLiteral kObjectFilePluginName("object-file");
17631761
static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file");
17641762
static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator");
1765-
static constexpr llvm::StringLiteral kTypeSystemPluginName("typesystem");
17661763
static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader");
17671764
static constexpr llvm::StringLiteral
17681765
kStructuredDataPluginName("structured-data");
@@ -1861,22 +1858,6 @@ bool PluginManager::CreateSettingForSymbolFilePlugin(
18611858
properties_sp, description, is_global_property);
18621859
}
18631860

1864-
lldb::OptionValuePropertiesSP
1865-
PluginManager::GetSettingForTypeSystemPlugin(Debugger &debugger,
1866-
ConstString setting_name) {
1867-
return GetSettingForPlugin(debugger, setting_name,
1868-
ConstString(kTypeSystemPluginName));
1869-
}
1870-
1871-
bool PluginManager::CreateSettingForTypeSystemPlugin(
1872-
Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1873-
ConstString description, bool is_global_property) {
1874-
return CreateSettingForPlugin(
1875-
debugger, ConstString(kTypeSystemPluginName),
1876-
ConstString("Settings for type system plug-ins"), properties_sp,
1877-
description, is_global_property);
1878-
}
1879-
18801861
lldb::OptionValuePropertiesSP
18811862
PluginManager::GetSettingForJITLoaderPlugin(Debugger &debugger,
18821863
llvm::StringRef setting_name) {

0 commit comments

Comments
 (0)