Skip to content

Commit ec3ccd7

Browse files
authored
Merge pull request #38896 from apple/revert-38746-objc-getclass-test
Revert "[Demangler][Tests] Add an explicit test for getObjCClassByMangledName."
2 parents d9b1489 + 34350e4 commit ec3ccd7

File tree

8 files changed

+5
-132
lines changed

8 files changed

+5
-132
lines changed

include/swift/Demangling/TypeLookupError.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ template <typename... Args>
207207
static TypeLookupError TypeLookupErrorImpl(const char *fmt, Args... args) {
208208
return TypeLookupError([=] {
209209
char *str;
210-
#pragma clang diagnostic push
211-
#pragma clang diagnostic ignored "-Wformat-security"
212210
swift_asprintf(&str, fmt, args...);
213-
#pragma clang diagnostic pop
214211
return str;
215212
});
216213
}

include/swift/Reflection/TypeRefBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "swift/Reflection/TypeLowering.h"
2525
#include "swift/Reflection/TypeRef.h"
2626
#include "llvm/ADT/Optional.h"
27+
2728
#include <vector>
2829
#include <unordered_map>
2930

lib/Demangling/Remangler.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,9 @@ std::pair<int, Node *> Remangler::mangleConstrainedType(Node *node,
441441
Chain.push_back(node->getChild(1), Factory);
442442
node = getChildOfType(node->getFirstChild());
443443
}
444-
444+
445445
if (node->getKind() != Node::Kind::DependentGenericParamType) {
446446
mangle(node, depth + 1);
447-
if (!Chain.size())
448-
return {-1, nullptr};
449447
node = nullptr;
450448
}
451449

stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,17 +3490,13 @@ swift::swift_getExistentialMetatypeMetadata(const Metadata *instanceMetadata) {
34903490
ExistentialMetatypeCacheEntry::ExistentialMetatypeCacheEntry(
34913491
const Metadata *instanceMetadata) {
34923492
ExistentialTypeFlags flags;
3493-
switch (instanceMetadata->getKind()) {
3494-
case MetadataKind::Existential:
3493+
if (instanceMetadata->getKind() == MetadataKind::Existential) {
34953494
flags = static_cast<const ExistentialTypeMetadata*>(instanceMetadata)
34963495
->Flags;
3497-
break;
3498-
case MetadataKind::ExistentialMetatype:
3496+
} else {
3497+
assert(instanceMetadata->getKind() == MetadataKind::ExistentialMetatype);
34993498
flags = static_cast<const ExistentialMetatypeMetadata*>(instanceMetadata)
35003499
->Flags;
3501-
break;
3502-
default:
3503-
assert(false && "expected existential metadata");
35043500
}
35053501

35063502
Data.setKind(MetadataKind::ExistentialMetatype);

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,12 +1446,6 @@ class DecodedMetadataBuilder {
14461446
TypeLookupErrorOr<BuiltType> createExistentialMetatypeType(
14471447
BuiltType instance,
14481448
llvm::Optional<Demangle::ImplMetatypeRepresentation> repr = None) const {
1449-
if (instance->getKind() != MetadataKind::Existential
1450-
&& instance->getKind() != MetadataKind::ExistentialMetatype) {
1451-
return TYPE_LOOKUP_ERROR_FMT("Tried to build an existential metatype from "
1452-
"a type that was neither an existential nor "
1453-
"an existential metatype");
1454-
}
14551449
return swift_getExistentialMetatypeMetadata(instance);
14561450
}
14571451

test/Demangle/Inputs/objc-getclass.txt

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

test/Demangle/lit.local.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# suffixes: A list of file extensions to treat as test files.
22
config.suffixes.add('.test')
3-
config.suffixes.add('.cpp')

test/Demangle/objc-getclass.cpp

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

0 commit comments

Comments
 (0)