Skip to content

Commit acde68c

Browse files
authored
Merge pull request #229 from Teemperor/RemoveCheckSwiftMaster
[upstreaming] Revert check_swift parameter to IsPossibleDynamicType
2 parents ae8ef6c + e7650fe commit acde68c

File tree

13 files changed

+25
-32
lines changed

13 files changed

+25
-32
lines changed

lldb/include/lldb/Symbol/ClangASTContext.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ class ClangASTContext : public TypeSystem {
585585

586586
bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
587587
CompilerType *target_type, // Can pass nullptr
588-
bool check_cplusplus, bool check_objc,
589-
bool check_swift) override;
588+
bool check_cplusplus, bool check_objc) override;
590589

591590
bool IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type) override;
592591

lldb/include/lldb/Symbol/CompilerType.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,11 @@ class CompilerType {
112112

113113
bool
114114
IsPossibleCPlusPlusDynamicType(CompilerType *target_type = nullptr) const {
115-
return IsPossibleDynamicType(target_type, true, false, false);
115+
return IsPossibleDynamicType(target_type, true, false);
116116
}
117117

118118
bool IsPossibleDynamicType(CompilerType *target_type, // Can pass nullptr
119-
bool check_cplusplus, bool check_objc,
120-
bool check_swift) const;
119+
bool check_cplusplus, bool check_objc) const;
121120

122121
bool IsPointerToScalarType() const;
123122

lldb/include/lldb/Symbol/SwiftASTContext.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,7 @@ class SwiftASTContext : public TypeSystem {
438438

439439
bool IsPossibleDynamicType(void *type,
440440
CompilerType *target_type, // Can pass NULL
441-
bool check_cplusplus, bool check_objc,
442-
bool check_swift) override;
441+
bool check_cplusplus, bool check_objc) override;
443442

444443
bool IsPointerType(void *type, CompilerType *pointee_type) override;
445444

lldb/include/lldb/Symbol/TypeSystem.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ class TypeSystem : public PluginInterface {
197197

198198
virtual bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
199199
CompilerType *target_type, // Can pass NULL
200-
bool check_cplusplus, bool check_objc,
201-
bool check_swift) = 0;
200+
bool check_cplusplus, bool check_objc) = 0;
202201

203202
virtual bool IsPointerType(lldb::opaque_compiler_type_t type,
204203
CompilerType *pointee_type) = 0;

lldb/source/Core/ValueObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ bool ValueObject::IsPossibleDynamicType() {
17591759
if (process)
17601760
return process->IsPossibleDynamicValue(*this);
17611761
else
1762-
return GetCompilerType().IsPossibleDynamicType(nullptr, true, true, true);
1762+
return GetCompilerType().IsPossibleDynamicType(nullptr, true, true);
17631763
}
17641764

17651765
bool ValueObject::IsRuntimeSupportValue() {

lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,11 @@ ObjCLanguage::GetPossibleFormattersMatches(ValueObject &valobj,
883883

884884
const bool check_cpp = false;
885885
const bool check_objc = true;
886-
const bool check_swift = false;
887-
bool canBeObjCDynamic = compiler_type.IsPossibleDynamicType(
888-
nullptr, check_cpp, check_objc, check_swift);
886+
bool canBeObjCDynamic =
887+
compiler_type.IsPossibleDynamicType(nullptr, check_cpp, check_objc);
889888

890-
if (canBeObjCDynamic) {
889+
bool is_clang_type = llvm::isa<ClangASTContext>(compiler_type.GetTypeSystem());
890+
if (canBeObjCDynamic && is_clang_type) {
891891
do {
892892
lldb::ProcessSP process_sp = valobj.GetProcessSP();
893893
if (!process_sp)

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,8 @@ std::vector<ConstString> SwiftLanguage::GetPossibleFormattersMatches(
886886

887887
const bool check_cpp = false;
888888
const bool check_objc = false;
889-
const bool check_swift = true;
890889
bool canBeSwiftDynamic = compiler_type.IsPossibleDynamicType(
891-
nullptr, check_cpp, check_objc, check_swift);
890+
nullptr, check_cpp, check_objc);
892891

893892
if (canBeSwiftDynamic) {
894893
do {

lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ char ItaniumABILanguageRuntime::ID = 0;
4848
bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
4949
const bool check_cxx = true;
5050
const bool check_objc = false;
51-
const bool check_swift = false;
5251
return in_value.GetCompilerType().IsPossibleDynamicType(
53-
nullptr, check_cxx, check_objc, check_swift);
52+
nullptr, check_cxx, check_objc);
5453
}
5554

5655
TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ bool AppleObjCRuntime::CouldHaveDynamicValue(ValueObject &in_value,
247247
return in_value.GetCompilerType().IsPossibleDynamicType(
248248
nullptr,
249249
false, // do not check C++
250-
true, // check ObjC
251-
allow_swift);
250+
true); // check ObjC
252251
}
253252

254253
bool AppleObjCRuntime::GetDynamicTypeAndAddress(

lldb/source/Symbol/ClangASTContext.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ bool ClangASTContext::IsPolymorphicClass(lldb::opaque_compiler_type_t type) {
37143714
bool ClangASTContext::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
37153715
CompilerType *dynamic_pointee_type,
37163716
bool check_cplusplus,
3717-
bool check_objc, bool check_swift) {
3717+
bool check_objc) {
37183718
clang::QualType pointee_qual_type;
37193719
if (type) {
37203720
clang::QualType qual_type(GetCanonicalQualType(type));
@@ -3770,26 +3770,26 @@ bool ClangASTContext::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
37703770
->getUnderlyingType()
37713771
.getAsOpaquePtr(),
37723772
dynamic_pointee_type, check_cplusplus,
3773-
check_objc, check_swift);
3773+
check_objc);
37743774

37753775
case clang::Type::Auto:
37763776
return IsPossibleDynamicType(llvm::cast<clang::AutoType>(qual_type)
37773777
->getDeducedType()
37783778
.getAsOpaquePtr(),
37793779
dynamic_pointee_type, check_cplusplus,
3780-
check_objc, check_swift);
3780+
check_objc);
37813781

37823782
case clang::Type::Elaborated:
37833783
return IsPossibleDynamicType(llvm::cast<clang::ElaboratedType>(qual_type)
37843784
->getNamedType()
37853785
.getAsOpaquePtr(),
37863786
dynamic_pointee_type, check_cplusplus,
3787-
check_objc, check_swift);
3787+
check_objc);
37883788

37893789
case clang::Type::Paren:
37903790
return IsPossibleDynamicType(
37913791
llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),
3792-
dynamic_pointee_type, check_cplusplus, check_objc, check_swift);
3792+
dynamic_pointee_type, check_cplusplus, check_objc);
37933793
default:
37943794
break;
37953795
}

lldb/source/Symbol/CompilerType.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ bool CompilerType::IsPolymorphicClass() const {
221221
}
222222

223223
bool CompilerType::IsPossibleDynamicType(CompilerType *dynamic_pointee_type,
224-
bool check_cplusplus, bool check_objc,
225-
bool check_swift) const {
224+
bool check_cplusplus,
225+
bool check_objc) const {
226226
if (IsValid())
227-
return m_type_system->IsPossibleDynamicType(
228-
m_type, dynamic_pointee_type, check_cplusplus, check_objc, check_swift);
227+
return m_type_system->IsPossibleDynamicType(m_type, dynamic_pointee_type,
228+
check_cplusplus, check_objc);
229229
return false;
230230
}
231231

lldb/source/Symbol/SwiftASTContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5314,10 +5314,10 @@ bool SwiftASTContext::IsPolymorphicClass(void *type) { return false; }
53145314
bool SwiftASTContext::IsPossibleDynamicType(void *type,
53155315
CompilerType *dynamic_pointee_type,
53165316
bool check_cplusplus,
5317-
bool check_objc, bool check_swift) {
5317+
bool check_objc) {
53185318
VALID_OR_RETURN(false);
53195319

5320-
if (type && check_swift) {
5320+
if (type) {
53215321
auto can_type = GetCanonicalSwiftType(type);
53225322

53235323
if (can_type->getClassOrBoundGenericClass() ||

lldb/source/Target/SwiftLanguageRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ bool SwiftLanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
26292629
// disable it.
26302630
return !in_value.IsBaseClass();
26312631
}
2632-
return var_type.IsPossibleDynamicType(nullptr, false, false, true);
2632+
return var_type.IsPossibleDynamicType(nullptr, false, false);
26332633
}
26342634

26352635
CompilerType

0 commit comments

Comments
 (0)