Skip to content

Commit 70a0d4a

Browse files
authored
Merge pull request #23182 from davezarzycki/latest_clang_build_fix
2 parents e5d4e0d + b032d0b commit 70a0d4a

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

include/swift/ABI/Metadata.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ struct TargetMetadata {
706706
#endif
707707

708708
#ifndef NDEBUG
709-
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
709+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const,
710710
"Only meant for use in the debugger");
711711
#endif
712712

@@ -2404,7 +2404,7 @@ struct TargetProtocolConformanceDescriptor final
24042404
///
24052405
/// 1. Has a valid TypeReferenceKind.
24062406
/// 2. Has a valid conformance kind.
2407-
void verify() const LLVM_ATTRIBUTE_USED;
2407+
void verify() const;
24082408
#endif
24092409

24102410
private:
@@ -2997,7 +2997,7 @@ struct TargetProtocolDescriptor final
29972997
}
29982998

29992999
#ifndef NDEBUG
3000-
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
3000+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const,
30013001
"only for use in the debugger");
30023002
#endif
30033003

include/swift/Runtime/ExistentialContainer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ struct TargetOpaqueExistentialContainer {
6464
///
6565
/// The intention is that this is used in combination with ASAN or Guard
6666
/// Malloc to catch use-after-frees.
67-
void verify() const LLVM_ATTRIBUTE_USED;
67+
void verify() const;
6868

6969
/// Dump information about this specific box and its contents. Only intended
7070
/// for use in the debugger.
71-
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
71+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const,
7272
"Only meant for use in the debugger");
7373
#endif
7474
};

stdlib/public/runtime/ExistentialContainer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ void OpaqueExistentialContainer::deinit() {
5757
// *NOTE* This routine performs unused memory reads on purpose to try to catch
5858
// use-after-frees in conjunction with ASAN or Guard Malloc.
5959
template <>
60+
LLVM_ATTRIBUTE_USED
6061
void OpaqueExistentialContainer::verify() const {
6162
// We do not actually care about value. We just want to see if the
6263
// memory is valid or not. So convert to a uint8_t and try to
@@ -70,6 +71,7 @@ void OpaqueExistentialContainer::verify() const {
7071

7172
/// Dump information about this specific container and its contents.
7273
template <>
74+
LLVM_ATTRIBUTE_USED
7375
void OpaqueExistentialContainer::dump() const {
7476
// Quickly verify to make sure we are well formed.
7577
verify();

stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3913,7 +3913,9 @@ StringRef swift::getStringForMetadataKind(MetadataKind kind) {
39133913
}
39143914

39153915
#ifndef NDEBUG
3916-
template <> void Metadata::dump() const {
3916+
template <>
3917+
LLVM_ATTRIBUTE_USED
3918+
void Metadata::dump() const {
39173919
printf("TargetMetadata.\n");
39183920
printf("Kind: %s.\n", getStringForMetadataKind(getKind()).data());
39193921
printf("Value Witnesses: %p.\n", getValueWitnesses());

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
using namespace swift;
3232

3333
#ifndef NDEBUG
34-
template <> void ProtocolDescriptor::dump() const {
34+
template <>
35+
LLVM_ATTRIBUTE_USED
36+
void ProtocolDescriptor::dump() const {
3537
printf("TargetProtocolDescriptor.\n"
3638
"Name: \"%s\".\n",
3739
Name.get());
@@ -93,7 +95,9 @@ template<> void ProtocolConformanceDescriptor::dump() const {
9395
#endif
9496

9597
#ifndef NDEBUG
96-
template<> void ProtocolConformanceDescriptor::verify() const {
98+
template<>
99+
LLVM_ATTRIBUTE_USED
100+
void ProtocolConformanceDescriptor::verify() const {
97101
auto typeKind = unsigned(getTypeKind());
98102
assert(((unsigned(TypeReferenceKind::First_Kind) <= typeKind) &&
99103
(unsigned(TypeReferenceKind::Last_Kind) >= typeKind)) &&

0 commit comments

Comments
 (0)